#include <object.h>
Public Member Functions | |
virtual std::string | toString () const |
Returns string representation of this object. | |
virtual int | getMemCost () const |
Returns memory cost of this object. | |
virtual bool | isDirty () |
Checks whether the object was modified since it was created or its dirty flag was reset. | |
virtual void | resetDirty () |
Resets the dirty flag of this object. | |
virtual void | setDirty (bool dirty=true) |
Sets the dirty flag to a specified value. | |
virtual int | compare (const Object &o) const |
Compares this object with another object. | |
virtual const Type & | getType () const |
Returns a Type Description representing the type of the current object. | |
const AttributeValue & | getAttributeValue (const std::string &name) const |
Returns an attributre value of a specified attribute. | |
const AttributeValuesMap & | getAttributeValues () const |
Returns a list of attribute values of attributes from this object. | |
virtual Object * | clone () const |
Returns a copy of this object. |
The iopcsp
utility processes classes that are descendants of Object only. Other classes can't be introspected using reflection features provided by this library.
Object provides infrastructure for dirty status tracking and a list of AttributeValue objects that allow developers to modify object attribute values using the reflection.
int iopc::Object::getMemCost | ( | ) | const [virtual] |
Returns memory cost of this object.
Memory cost is computed as a sum over Type::getSizeOf(attribute value).
int iopc::Object::compare | ( | const Object & | o | ) | const [virtual] |
Compares this object with another object.
This function is called whenever persistent attributes are modified. This implementation compares memory addresses of the involved objects.
o | Object to compare with |
Reimplemented in iopc::ENumber< T >, iopc::EStr< T >, iopc::EStr< wchar_t >, and iopc::EStr< char >.
const AttributeValue & iopc::Object::getAttributeValue | ( | const std::string & | name | ) | const |
const AttributeValuesMap& iopc::Object::getAttributeValues | ( | ) | const [inline] |
Object * iopc::Object::clone | ( | ) | const [virtual] |
Returns a copy of this object.
Object descendants may implement this method in various ways. Default implementation returns only an empty Object instance.
Reimplemented in iopc::ENumber< T >, iopc::EStr< T >, iopc::EStr< wchar_t >, and iopc::EStr< char >.