Odyssey::PropertyBase Class Reference

The base class for all Property types. More...

#include <property.h>

Inheritance diagram for Odyssey::PropertyBase:

Odyssey::MapProperty< TypeT, TraitsT, MapTraitsT > Odyssey::Property< TypeT, TraitsT > Odyssey::VectorProperty< TypeT, TraitsT, VectorTraitsT > List of all members.

Public Types

typedef std::map< String,
Variable
AttributeMap
typedef MapContainerIterator<
AttributeMap
AttributeIterator
typedef ConstMapContainerIterator<
AttributeMap
ConstAttributeIterator

Public Member Functions

virtual ~PropertyBase ()
virtual const type_info & getTypeInfo () const =0
 Returns the type information for the held type.
ModelgetModel () const
 Returns the owner Model for this Property.
void clearChanged ()
 Clears the change state.
bool isChanged () const
 Returns true if this Property has been changed.
void lock ()
 Locks the property from being written to.
void unlock ()
 Unlocks the property for writing.
bool isLocked () const
 Returns true if the property is locked against writing.
bool containsAttribute (const String &name) const
 Returns true of this property contains an Attribute with the given name.
void setAttribute (const String &name, const Variable &attr)
 Sets the attribute value with the given name.
Variable getAttribute (const String &name) const
 Returns the attribute value with the given name.
AttributeIterator getAttributeIterator ()
 Returns an iterator over the attributes.
ConstAttributeIterator getAttributeIterator () const
 Returns an iterator over the attributes.
void addListener (PropertyListener *listener)
 Adds a new listener for notifications.
void removeListener (PropertyListener *listener)
 Removes the given listener from this property.
void clearListeners ()
 Removes all of the listeners for this property.
void notifyListeners ()
 Send notifications to each listener.
void notifyListeners (PropertyListener *listener)
 Send notifications to each listener but the specified one.
void linkProperty (PropertyBase *prop)
 Links the given property to this one.
void linkProperty (PropertyBase *prop, PropertyLinkPtr link)
 Links the given property to this one.
void unlinkProperty (PropertyBase *prop)
 Removes a previously-linked property.
void clearLinkedProperties ()
 Removes all of the linked properties.
void _syncLinkedProperties ()
 Syncs the linked properties with this one.
virtual void _fromAny (const Any &)
 Internal function for conversion from an Any.
virtual Any _toAny () const
 Internal function for conversion to an Any.
virtual void _fromString (const Odyssey::String &)
 Internal function for conversion from a String.
virtual Odyssey::String _toString () const
 Internal function for conversion to a String.
virtual void _fromAny (size_t, const Any &)
 Internal function for conversion from an Any.
virtual Any _toAny (size_t) const
 Internal function for conversion to an Any.
virtual void _fromString (size_t, const Odyssey::String &)
 Internal function for conversion from a String.
virtual Odyssey::String _toString (size_t) const
 Internal function for conversion to a String.
virtual void _fromAny (const String &, const Any &)
 Internal function for conversion from an Any.
virtual Any _toAny (const String &) const
 Internal function for conversion to an Any.
virtual void _fromString (const String &, const Odyssey::String &)
 Internal function for conversion from a String.
virtual Odyssey::String _toString (const String &) const
 Internal function for conversion to a String.
PropertyProxy createProxy ()
 Creates a new proxy object for this property.
virtual Variable var () const
 Returns a variable representation of this property's data.
virtual Variable var (size_t) const
 Returns a variable representation of this property's data.
virtual Variable var (const Odyssey::String &) const
 Returns a variable representation of this property's data.
virtual PropertyValueIteratorPtr createValueIterator () const
 Creates a new iterator for the values in the property.

Protected Types

typedef std::map< PropertyBase *,
PropertyLinkPtr
LinkMap

Protected Member Functions

 PropertyBase ()
void setChanged ()

Protected Attributes

bool _locked
AttributeMap _attributes
LinkMap _links

Friends

class Model

Detailed Description

The base class for all Property types.

This is the base class for all Property types in Odyssey. It provides generic data conversions (similar to the holders for variables), as well as behavior to track change state, attributes, and listeners.


Member Typedef Documentation

typedef MapContainerIterator<AttributeMap> Odyssey::PropertyBase::AttributeIterator
 

typedef std::map<String,Variable> Odyssey::PropertyBase::AttributeMap
 

typedef ConstMapContainerIterator<AttributeMap> Odyssey::PropertyBase::ConstAttributeIterator
 

typedef std::map<PropertyBase*,PropertyLinkPtr> Odyssey::PropertyBase::LinkMap [protected]
 


Constructor & Destructor Documentation

Odyssey::PropertyBase::PropertyBase  )  [protected]
 

virtual Odyssey::PropertyBase::~PropertyBase  )  [virtual]
 


Member Function Documentation

virtual void Odyssey::PropertyBase::_fromAny const String ,
const Any
[virtual]
 

Internal function for conversion from an Any.

Reimplemented in Odyssey::MapProperty< TypeT, TraitsT, MapTraitsT >, and Odyssey::MapProperty< TypeT, TraitsT >.

virtual void Odyssey::PropertyBase::_fromAny size_t  ,
const Any
[virtual]
 

Internal function for conversion from an Any.

Reimplemented in Odyssey::VectorProperty< TypeT, TraitsT, VectorTraitsT >, and Odyssey::VectorProperty< TypeT, TraitsT >.

virtual void Odyssey::PropertyBase::_fromAny const Any  )  [virtual]
 

Internal function for conversion from an Any.

Reimplemented in Odyssey::MapProperty< TypeT, TraitsT, MapTraitsT >, Odyssey::Property< TypeT, TraitsT >, Odyssey::VectorProperty< TypeT, TraitsT, VectorTraitsT >, Odyssey::MapProperty< TypeT, TraitsT >, and Odyssey::VectorProperty< TypeT, TraitsT >.

virtual void Odyssey::PropertyBase::_fromString const String ,
const Odyssey::String
[virtual]
 

Internal function for conversion from a String.

Reimplemented in Odyssey::MapProperty< TypeT, TraitsT, MapTraitsT >, and Odyssey::MapProperty< TypeT, TraitsT >.

virtual void Odyssey::PropertyBase::_fromString size_t  ,
const Odyssey::String
[virtual]
 

Internal function for conversion from a String.

Reimplemented in Odyssey::VectorProperty< TypeT, TraitsT, VectorTraitsT >, and Odyssey::VectorProperty< TypeT, TraitsT >.

virtual void Odyssey::PropertyBase::_fromString const Odyssey::String  )  [virtual]
 

Internal function for conversion from a String.

Reimplemented in Odyssey::Property< TypeT, TraitsT >.

void Odyssey::PropertyBase::_syncLinkedProperties  ) 
 

Syncs the linked properties with this one.

virtual Any Odyssey::PropertyBase::_toAny const String  )  const [virtual]
 

Internal function for conversion to an Any.

Reimplemented in Odyssey::MapProperty< TypeT, TraitsT, MapTraitsT >, and Odyssey::MapProperty< TypeT, TraitsT >.

virtual Any Odyssey::PropertyBase::_toAny size_t   )  const [virtual]
 

Internal function for conversion to an Any.

Reimplemented in Odyssey::VectorProperty< TypeT, TraitsT, VectorTraitsT >, and Odyssey::VectorProperty< TypeT, TraitsT >.

virtual Any Odyssey::PropertyBase::_toAny  )  const [virtual]
 

Internal function for conversion to an Any.

Reimplemented in Odyssey::MapProperty< TypeT, TraitsT, MapTraitsT >, Odyssey::Property< TypeT, TraitsT >, Odyssey::VectorProperty< TypeT, TraitsT, VectorTraitsT >, Odyssey::MapProperty< TypeT, TraitsT >, and Odyssey::VectorProperty< TypeT, TraitsT >.

virtual Odyssey::String Odyssey::PropertyBase::_toString const String  )  const [virtual]
 

Internal function for conversion to a String.

Reimplemented in Odyssey::MapProperty< TypeT, TraitsT, MapTraitsT >, and Odyssey::MapProperty< TypeT, TraitsT >.

virtual Odyssey::String Odyssey::PropertyBase::_toString size_t   )  const [virtual]
 

Internal function for conversion to a String.

Reimplemented in Odyssey::VectorProperty< TypeT, TraitsT, VectorTraitsT >, and Odyssey::VectorProperty< TypeT, TraitsT >.

virtual Odyssey::String Odyssey::PropertyBase::_toString  )  const [virtual]
 

Internal function for conversion to a String.

Reimplemented in Odyssey::Property< TypeT, TraitsT >.

void Odyssey::PropertyBase::addListener PropertyListener listener  ) 
 

Adds a new listener for notifications.

void Odyssey::PropertyBase::clearChanged  ) 
 

Clears the change state.

This function will set the change state back to false. This means that no matter what, this Property will be flagged as unchanged.

void Odyssey::PropertyBase::clearLinkedProperties  ) 
 

Removes all of the linked properties.

void Odyssey::PropertyBase::clearListeners  ) 
 

Removes all of the listeners for this property.

bool Odyssey::PropertyBase::containsAttribute const String name  )  const
 

Returns true of this property contains an Attribute with the given name.

PropertyProxy Odyssey::PropertyBase::createProxy  ) 
 

Creates a new proxy object for this property.

This function will generate a proxy which can be used for remote (i.e. not direct) access to this property. The Proxy provides more convenient interfaces for the property's behaviors.

virtual PropertyValueIteratorPtr Odyssey::PropertyBase::createValueIterator  )  const [virtual]
 

Creates a new iterator for the values in the property.

This function creates a new value iterator to access the value(s) that are stored in this property. The iterator will be defined by Property implementations.

Reimplemented in Odyssey::MapProperty< TypeT, TraitsT, MapTraitsT >, Odyssey::Property< TypeT, TraitsT >, Odyssey::VectorProperty< TypeT, TraitsT, VectorTraitsT >, Odyssey::MapProperty< TypeT, TraitsT >, and Odyssey::VectorProperty< TypeT, TraitsT >.

Variable Odyssey::PropertyBase::getAttribute const String name  )  const
 

Returns the attribute value with the given name.

ConstAttributeIterator Odyssey::PropertyBase::getAttributeIterator  )  const
 

Returns an iterator over the attributes.

AttributeIterator Odyssey::PropertyBase::getAttributeIterator  ) 
 

Returns an iterator over the attributes.

Model* Odyssey::PropertyBase::getModel  )  const
 

Returns the owner Model for this Property.

virtual const type_info& Odyssey::PropertyBase::getTypeInfo  )  const [pure virtual]
 

Returns the type information for the held type.

Implemented in Odyssey::MapProperty< TypeT, TraitsT, MapTraitsT >, Odyssey::Property< TypeT, TraitsT >, Odyssey::VectorProperty< TypeT, TraitsT, VectorTraitsT >, Odyssey::MapProperty< TypeT, TraitsT >, and Odyssey::VectorProperty< TypeT, TraitsT >.

bool Odyssey::PropertyBase::isChanged  )  const
 

Returns true if this Property has been changed.

bool Odyssey::PropertyBase::isLocked  )  const [inline]
 

Returns true if the property is locked against writing.

void Odyssey::PropertyBase::linkProperty PropertyBase prop,
PropertyLinkPtr  link
 

Links the given property to this one.

This function will link a property to this one. It allows for you to assign a filter and a mutator to this link. This lets you control when and how the update happpens.

Parameters:
prop the property to link to this one
link the link to control the effect of linking

void Odyssey::PropertyBase::linkProperty PropertyBase prop  ) 
 

Links the given property to this one.

This function links a new property to this one. Whenever this property is changed, the links properties are automatically synced.

Parameters:
prop the property to link to this one

void Odyssey::PropertyBase::lock  ) 
 

Locks the property from being written to.

void Odyssey::PropertyBase::notifyListeners PropertyListener listener  ) 
 

Send notifications to each listener but the specified one.

void Odyssey::PropertyBase::notifyListeners  ) 
 

Send notifications to each listener.

void Odyssey::PropertyBase::removeListener PropertyListener listener  ) 
 

Removes the given listener from this property.

void Odyssey::PropertyBase::setAttribute const String name,
const Variable attr
 

Sets the attribute value with the given name.

void Odyssey::PropertyBase::setChanged  )  [protected]
 

void Odyssey::PropertyBase::unlinkProperty PropertyBase prop  ) 
 

Removes a previously-linked property.

void Odyssey::PropertyBase::unlock  ) 
 

Unlocks the property for writing.

virtual Variable Odyssey::PropertyBase::var const Odyssey::String  )  const [virtual]
 

Returns a variable representation of this property's data.

Reimplemented in Odyssey::MapProperty< TypeT, TraitsT, MapTraitsT >, and Odyssey::MapProperty< TypeT, TraitsT >.

virtual Variable Odyssey::PropertyBase::var size_t   )  const [virtual]
 

Returns a variable representation of this property's data.

Reimplemented in Odyssey::VectorProperty< TypeT, TraitsT, VectorTraitsT >, and Odyssey::VectorProperty< TypeT, TraitsT >.

virtual Variable Odyssey::PropertyBase::var  )  const [virtual]
 

Returns a variable representation of this property's data.

Reimplemented in Odyssey::MapProperty< TypeT, TraitsT, MapTraitsT >, Odyssey::Property< TypeT, TraitsT >, Odyssey::VectorProperty< TypeT, TraitsT, VectorTraitsT >, Odyssey::MapProperty< TypeT, TraitsT >, and Odyssey::VectorProperty< TypeT, TraitsT >.


Friends And Related Function Documentation

friend class Model [friend]
 


Member Data Documentation

AttributeMap Odyssey::PropertyBase::_attributes [protected]
 

LinkMap Odyssey::PropertyBase::_links [protected]
 

bool Odyssey::PropertyBase::_locked [protected]
 


The documentation for this class was generated from the following file:
Generated on Sun Jan 7 01:18:53 2007 for Odyssey Meta-Engine by  doxygen 1.4.6-NO