14 #ifndef _DYNAMIC_ATTRIBUTE_H_
15 #define _DYNAMIC_ATTRIBUTE_H_
55 unsigned int minInstancesCount = 0,
unsigned int maxInstancesCount = 10)
59 this->minInstancesCount = minInstancesCount;
60 this->maxInstancesCount = maxInstancesCount;
69 attributesListIter = attributesList.begin();
72 while (attributesListIter != attributesList.end())
75 if (*attributesListIter !=
null)
78 delete *attributesListIter;
79 *attributesListIter =
null;
92 inline unsigned int getMinInstancesCount()
const
94 return minInstancesCount;
102 inline unsigned int getMaxInstancesCount()
const
104 return maxInstancesCount;
132 attributesList.push_back(pAttribute);
133 attributesMap[pAttribute->
getName()] = pAttribute;
143 inline unsigned int attributesCount()
const
145 return attributesList.size();
155 inline bool containsAttribute(
const string& strName)
const
157 return (attributesMap.find(strName) != attributesMap.end());
167 inline const Attribute* getAttributePtr(
const string& strName)
const
169 return attributesMap.find(strName)->second;
175 inline void startIteration()
177 attributesListIter = attributesList.begin();
191 inline bool hasNextAttribute()
const
193 return (attributesListIter != attributesList.end());
209 return *attributesListIter++;
215 unsigned int minInstancesCount;
216 unsigned int maxInstancesCount;
219 list<Attribute*> attributesList;
220 map<string, const Attribute*> attributesMap;
223 list<Attribute*>::iterator attributesListIter;