MIRA
|
The property manager maintains the properties of objects that are added to the manager. More...
#include <serialization/PropertyManager.h>
Public Member Functions | |
PropertyManager () | |
template<typename T > | |
void | addObject (const char *name, T &object) |
Add the specified object to the PropertyManager under the specified name. More... | |
template<typename T > | |
void | setProperty (const std::string &name, const T &value) |
Modifies the value of the specified property. More... | |
template<typename T > | |
T | getProperty (const std::string &name) const |
Obtains the value of the specified property. More... | |
const PropertyNode * | getRootNode () const |
Returns the root node of the managed property tree. More... | |
PropertyNode * | getRootNode () |
Returns the root node of the managed property tree. More... | |
const PropertyNode * | getPropertyNode (const std::string &name) const |
Returns the PropertyNode that represents the specified property. More... | |
PropertyNode * | getPropertyNode (const std::string &name) |
Returns the PropertyNode that represents the specified property. More... | |
template<typename T > | |
const TypedPropertyNode< T > * | getPropertyNode (const std::string &name) const |
Returns a typed PropertyNode that represents the specified property. More... | |
template<typename T > | |
TypedPropertyNode< T > * | getPropertyNode (const std::string &name) |
Returns the PropertyNode that represents the specified property. More... | |
The property manager maintains the properties of objects that are added to the manager.
A property is a special member of an object that is reflected via the "property" method to indicate that the member can be changed dynamically at runtime. For each object that is added via the addObject() method, all properties are reflected using the PropertySerializer. For each property a PropertyNode is created and stored within the manager. The value of properties of managed objects can be set and obtained using the setProperty() and getProperty() methods. Moreover, the PropertyNode of a property can be obtained directly through the getPropertyNode() methods.
|
inline |
|
inline |
Add the specified object to the PropertyManager under the specified name.
After calling this method, the properties of the object can be obtained and modified using the getProperty() and setProperty() methods. For each property within the objects members, a PropertyNode is created.
|
inline |
Modifies the value of the specified property.
The property is addressed via its full name. The following example:
accesses the property member "value" of the member "myMember" of the object "myObject" that was added via addObject.
XBadCast | If the specified property is not of type T. |
XLogical | If the property is read-only, or does not exist. |
|
inline |
Obtains the value of the specified property.
The property is addressed via its full name. The following example:
accesses the property member "value" of the member "myMember" of the object "myObject" that was added via addObject.
XBadCast | If the specified property is not of type T. |
XLogical | If the property does not exist. |
|
inline |
Returns the root node of the managed property tree.
Each child node of the root node corresponds to an object that was added via addObject().
|
inline |
Returns the root node of the managed property tree.
Each child node of the root node corresponds to an object that was added via addObject().
|
inline |
Returns the PropertyNode that represents the specified property.
The property is addressed via its full name. The following example:
returns the PropertyNode of the property member "value" of the member "myMember" of the object "myObject" that was added via addObject. Returns nullptr if no property with the given name exists.
|
inline |
Returns the PropertyNode that represents the specified property.
The property is addressed via its full name. The following example:
returns the PropertyNode of the property member "value" of the member "myMember" of the object "myObject" that was added via addObject. Returns nullptr if no property with the given name exists.
|
inline |
Returns a typed PropertyNode that represents the specified property.
The property is addressed via its full name. The following example:
returns the PropertyNode of the property member "value" of the member "myMember" of the object "myObject" that was added via addObject. Returns nullptr if no property with the given name exists.
XBadCast | If the specified property is not of type T. |
|
inline |
Returns the PropertyNode that represents the specified property.
The property is addressed via its full name. The following example:
returns the PropertyNode of the property member "value" of the member "myMember" of the object "myObject" that was added via addObject. Returns nullptr if no property with the given name exists.