| 49 | const std::string EMPTY_STRING(""); |
| 50 | |
| 51 | std::string Component::getStringParam(const std::string& id, const ParameterMap& params) |
| 52 | { |
| 53 | ParameterMap::const_iterator it=params.find(id); |
| 54 | if (it!=params.end()) { |
| 55 | if (it->second.size()==0) { |
| 56 | cerr << "ERROR: parameter " << id << " is empty !" << endl; |
| 57 | return EMPTY_STRING; |
| 58 | } |
| 59 | return it->second; |
| 60 | } |
| 61 | ParameterDescriptorList pList = getParameterDescriptorList(); |
| 62 | for (ParameterDescriptorList::const_iterator descIt=pList.begin(); |
| 63 | descIt!=pList.end(); descIt++) |
| 64 | { |
| 65 | if (descIt->m_identifier==id) |
| 66 | return descIt->m_defaultValue; |
| 67 | } |
| 68 | cerr << "ERROR: no parameter " << id << " for component " << getIdentifier() << " !" << endl; |
| 69 | return EMPTY_STRING; |
| 70 | } |
| 71 | |
| 72 | int Component::getIntParam(const std::string& id, const ParameterMap& params) |
| 73 | { |