#include <Facet.h>
Inheritance diagram for Odyssey::Facet:
Public Types | |
typedef boost::variant< size_t, String, ModelPtr > | ModelLink |
typedef std::vector< ModelLink > | ModelLinkList |
Public Member Functions | |
virtual | ~Facet () |
Element * | getElement () 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. | |
Model * | getLinkedModel (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, Variable > | onMessage (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... |
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.
|
|
|
|
|
|
|
|
|
Registers this facet with the ElementManager for updates next cycle.
|
|
Returns the Element this facet is a child of.
|
|
Retrieves the Model for the given link, or null if there isn't one.
|
|
Retrieves a link handle for the given Model, if it exists.
|
|
Retrieves a link handle for the given indexed Model, if it exists.
|
|
Retrieves a link handle for the given named Model, if it exists.
|
|
Returns a ModelLinkIterator over the linked Models for this facet.
|
|
Returns true if message handling has been locked.
|
|
Link this facet to the given Model.
|
|
Link this facet to the indexed Model (index within ModelManager).
|
|
Link this facet to the named Model.
|
|
Locks message handling to return the given value.
|
|
Called when the Element is activated.
|
|
Called when the Element is created.
|
|
Called when the Element is deactivated.
|
|
Called when the Element is destroyed.
|
|
This event is called when a message needs to be handled (it is processed).
Reimplemented from Odyssey::MessageAdapter. |
|
|
|
|
|
Implements Odyssey::ModelListener. |
|
Called when the Element is updated.
|
|
Removes a link between this facet and the link for the given handle.
|
|
Unlocks message handling for this facet.
|
|
|
|
|
|
|