#include <AttributesDescription.h>
Represents a attributes description container.
This class serves as a container for objects of Attribute class. It is meant to be used as a root node in the attributes description hierarchy. You can insert both static and dynamic attributes (provided these have at least one sub-attribute).
- See Also
- Attribute
-
StaticAttribute
-
DynamicAttribute
vrecko::AttributesDescription::~AttributesDescription |
( |
| ) |
|
|
inline |
Performs cleanup before object destruction.
bool vrecko::AttributesDescription::addAttribute |
( |
Attribute * |
pAttribute | ) |
|
|
inline |
Adds an attribute if not already included.
Any pointers passed to this method as parameters are used directly, no copy is made. You have to ensure a unique pointer is passed per each call of this method. Also ensure that the pointer is used only wihtin the context of this method and nowhere else and stays valid all the time. Allocated memory is freed automatically.
- Parameters
-
pAttribute | pointer to an Attribute object on the heap |
- Returns
- true if the attribute has been added, false otherwise
unsigned int vrecko::AttributesDescription::attributesCount |
( |
| ) |
const |
|
inline |
Returns attributes count.
- Returns
- number of attributes present
bool vrecko::AttributesDescription::containsAttribute |
( |
const string & |
strName | ) |
const |
|
inline |
"Contains attribute" predicate.
- Parameters
-
strName | reference to a constant attribute name used as a key for searching |
- Returns
- true if an attribute with given name is contained, false otherwise
const Attribute* vrecko::AttributesDescription::getAttributePtr |
( |
const string & |
strName | ) |
const |
|
inline |
Returns pointer to an attribute based on its name.
- Parameters
-
strName | reference to a constant attribute name used as a key for searching |
- Returns
- pointer to a constant Attribute object
bool vrecko::AttributesDescription::hasAnyAttributes |
( |
| ) |
const |
|
inline |
"Has any attribute" predicate.
- Returns
- true if any attribute is contained, false otherwise
bool vrecko::AttributesDescription::hasNextAttribute |
( |
| ) |
const |
|
inline |
const Attribute* vrecko::AttributesDescription::nextAttributePtr |
( |
| ) |
|
|
inline |
Returns pointer to current attribute and increments the iterator.
You have to initialize the internal interator first by calling startIteration() before you call this method!
- Returns
- pointer to a constant Attribute object pointed to by the internal iterator
- See Also
- startIteration()
-
hasNextAttribute()
void vrecko::AttributesDescription::startIteration |
( |
| ) |
|
|
inline |
Initializes the internal iterator.
The documentation for this class was generated from the following file: