vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vrecko::AttributesDescription Class Reference

#include <AttributesDescription.h>

Public Member Functions

 ~AttributesDescription ()
 
bool addAttribute (Attribute *pAttribute)
 
bool hasAnyAttributes () const
 
unsigned int attributesCount () const
 
bool containsAttribute (const string &strName) const
 
const AttributegetAttributePtr (const string &strName) const
 
void startIteration ()
 
bool hasNextAttribute () const
 
const AttributenextAttributePtr ()
 

Detailed Description

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

Constructor & Destructor Documentation

vrecko::AttributesDescription::~AttributesDescription ( )
inline

Performs cleanup before object destruction.

Member Function Documentation

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
pAttributepointer 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
strNamereference 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
strNamereference 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

"Has next attribute" predicate.

You have to initialize the internal interator first by calling startIteration() before you call this method!

Returns
true if there is a next attribute in the object
See Also
startIteration()
nextAttributePtr()
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: