Odyssey::Facet Class Reference

Contains behaviors for Elements and links to Models. More...

#include <Facet.h>

Inheritance diagram for Odyssey::Facet:

Odyssey::ModelListener Odyssey::MessageAdapter Odyssey::MessageListener List of all members.

Public Types

typedef boost::variant< size_t,
String, ModelPtr
ModelLink
typedef std::vector< ModelLinkModelLinkList

Public Member Functions

virtual ~Facet ()
ElementgetElement () const
 Returns the Element this facet is a child of.
virtual void onCreated ()
 Called when the Element is created.
virtual void onDestroyed ()
 Called when the Element is destroyed.
virtual void onActivated ()
 Called when the Element is activated.
virtual void onDeactivated ()
 Called when the Element is deactivated.
virtual void onUpdate ()
 Called when the Element is updated.
ModelLinkHandle linkModel (const String &name)
 Link this facet to the named Model.
ModelLinkHandle linkModel (size_t index)
 Link this facet to the indexed Model (index within ModelManager).
ModelLinkHandle linkModel (ModelPtr model)
 Link this facet to the given Model.
void unlinkModel (ModelLinkHandle link)
 Removes a link between this facet and the link for the given handle.
ModelLinkHandle getModelLinkHandle (const String &name) const
 Retrieves a link handle for the given named Model, if it exists.
ModelLinkHandle getModelLinkHandle (size_t index) const
 Retrieves a link handle for the given indexed Model, if it exists.
ModelLinkHandle getModelLinkHandle (ModelPtr model) const
 Retrieves a link handle for the given Model, if it exists.
ModelgetLinkedModel (ModelLinkHandle handle) const
 Retrieves the Model for the given link, or null if there isn't one.
ModelLinkIterator getModelLinkIterator ()
 Returns a ModelLinkIterator over the linked Models for this facet.
void _notifyUpdate ()
 Registers this facet with the ElementManager for updates next cycle.
std::pair< bool, VariableonMessage (const Message &msg)
 This event is called when a message needs to be handled (it is processed).
void lock (bool ret=true)
 Locks message handling to return the given value.
void unlock ()
 Unlocks message handling for this facet.
bool isLocked () const
 Returns true if message handling has been locked.

Protected Member Functions

 Facet ()
virtual void onNotify (Model *)
virtual void onModelLink (ModelLinkHandle handle)
virtual void onModelUnlink (ModelLinkHandle handle)

Protected Attributes

Element_element
ModelLinkList _links

Friends

class Element

Classes

class  ModelLinkHandle
 Represents a Model link within a facet. More...
class  ModelLinkIterator
 Iterator over the Model links. More...

Detailed Description

Contains behaviors for Elements and links to Models.

This class contains behaviors for Elements. The behaviors are linked to Models to form a connection between the controller and the model and to help separate related and unrelated behaviors and data.


Member Typedef Documentation

typedef boost::variant<size_t,String,ModelPtr> Odyssey::Facet::ModelLink
 

typedef std::vector<ModelLink> Odyssey::Facet::ModelLinkList
 


Constructor & Destructor Documentation

Odyssey::Facet::Facet  )  [protected]
 

virtual Odyssey::Facet::~Facet  )  [virtual]
 


Member Function Documentation

void Odyssey::Facet::_notifyUpdate  ) 
 

Registers this facet with the ElementManager for updates next cycle.

Element* Odyssey::Facet::getElement  )  const
 

Returns the Element this facet is a child of.

Model* Odyssey::Facet::getLinkedModel ModelLinkHandle  handle  )  const
 

Retrieves the Model for the given link, or null if there isn't one.

ModelLinkHandle Odyssey::Facet::getModelLinkHandle ModelPtr  model  )  const
 

Retrieves a link handle for the given Model, if it exists.

ModelLinkHandle Odyssey::Facet::getModelLinkHandle size_t  index  )  const
 

Retrieves a link handle for the given indexed Model, if it exists.

ModelLinkHandle Odyssey::Facet::getModelLinkHandle const String name  )  const
 

Retrieves a link handle for the given named Model, if it exists.

ModelLinkIterator Odyssey::Facet::getModelLinkIterator  ) 
 

Returns a ModelLinkIterator over the linked Models for this facet.

bool Odyssey::Facet::isLocked  )  const
 

Returns true if message handling has been locked.

ModelLinkHandle Odyssey::Facet::linkModel ModelPtr  model  ) 
 

Link this facet to the given Model.

ModelLinkHandle Odyssey::Facet::linkModel size_t  index  ) 
 

Link this facet to the indexed Model (index within ModelManager).

ModelLinkHandle Odyssey::Facet::linkModel const String name  ) 
 

Link this facet to the named Model.

void Odyssey::Facet::lock bool  ret = true  ) 
 

Locks message handling to return the given value.

virtual void Odyssey::Facet::onActivated  )  [virtual]
 

Called when the Element is activated.

virtual void Odyssey::Facet::onCreated  )  [virtual]
 

Called when the Element is created.

virtual void Odyssey::Facet::onDeactivated  )  [virtual]
 

Called when the Element is deactivated.

virtual void Odyssey::Facet::onDestroyed  )  [virtual]
 

Called when the Element is destroyed.

std::pair<bool,Variable> Odyssey::Facet::onMessage const Message msg  )  [virtual]
 

This event is called when a message needs to be handled (it is processed).

Reimplemented from Odyssey::MessageAdapter.

virtual void Odyssey::Facet::onModelLink ModelLinkHandle  handle  )  [protected, virtual]
 

virtual void Odyssey::Facet::onModelUnlink ModelLinkHandle  handle  )  [protected, virtual]
 

virtual void Odyssey::Facet::onNotify Model  )  [protected, virtual]
 

Implements Odyssey::ModelListener.

virtual void Odyssey::Facet::onUpdate  )  [virtual]
 

Called when the Element is updated.

void Odyssey::Facet::unlinkModel ModelLinkHandle  link  ) 
 

Removes a link between this facet and the link for the given handle.

void Odyssey::Facet::unlock  ) 
 

Unlocks message handling for this facet.


Friends And Related Function Documentation

friend class Element [friend]
 


Member Data Documentation

Element* Odyssey::Facet::_element [protected]
 

ModelLinkList Odyssey::Facet::_links [protected]
 


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