iopc::Object Class Reference

Ancestor for all reflection-capable classes. More...

#include <object.h>

Inheritance diagram for iopc::Object:

Inheritance graph
[legend]

List of all members.

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 TypegetType () const
 Returns a Type Description representing the type of the current object.
const AttributeValuegetAttributeValue (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 Objectclone () const
 Returns a copy of this object.


Detailed Description

Ancestor for all reflection-capable classes.

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.


Member Function Documentation

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.

Parameters:
o Object to compare with
Returns:
0 - equal, -1 this < o, 1 this > o

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

Returns an attributre value of a specified attribute.

See also:
AttributeValue

const AttributeValuesMap& iopc::Object::getAttributeValues (  )  const [inline]

Returns a list of attribute values of attributes from this object.

See also:
AttributeValue

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 >.


The documentation for this class was generated from the following files:

Generated on Tue Apr 14 16:46:37 2009 for IOPC 2 by  doxygen 1.5.6