Overview     Modules     Class Hierarchy     Classes     Members  

tlp::OLOObject Class Reference
[Observable]

OLOObject is the base class of the Observable/Listener/Observer object hierachy. It manages storage of a unique id for these objects as well as the storage of relations between them. It also manages destruction of these objects. More...

#include <Observable.h>

Inheritance diagram for tlp::OLOObject:
Collaboration diagram for tlp::OLOObject:

List of all members.

Public Member Functions

Static Public Member Functions

Protected Types

Protected Member Functions

Friends


Detailed Description

OLOObject is the base class of the Observable/Listener/Observer object hierachy. It manages storage of a unique id for these objects as well as the storage of relations between them. It also manages destruction of these objects.

Each Observable/listener/Observer is stored in a VectorGraph object as a node. An edge in that graph represents a connection between an Observable and a Listener/Observer. OLOObject enables to manage the creation/destruction of node when a Observable/Listener/Observer is created/deleted. OLOObject also enables to guarantee the coherency of relations between Observable and Listener/Observer.

OLOObject provides functions to access to the graph of OLOObjects as well as the state of elements in that graph. Using these functions can ease debugging of complex Observable/Listener/Observer systems.

Warning:
Due to the possibility to delay event sending, it is possible that nodes or edges in the graph don't represent the connections and objects that the user expect. Indeed, node deletion, edge creation and edge deletion are delayed until the Obserable::notify or Obserable::unholdObserver function terminate. Only node creation is not delayed.
See also:
Listener
Observer
Observable

Member Enumeration Documentation

enum tlp::OLOObject::OLOEDGETYPE [protected]
Enumerator:
OBSERVABLE 
OBSERVER 
LISTENER 

Constructor & Destructor Documentation

tlp::OLOObject::OLOObject (  )  [protected]
tlp::OLOObject::OLOObject ( const OLOObject  )  [protected]
virtual tlp::OLOObject::~OLOObject (  )  [protected, virtual]

Member Function Documentation

tlp::Iterator<tlp::node>* tlp::OLOObject::getInObjects (  )  const [protected]

return an iterator on in objects (Observable), the iterator guarantee that all objects are alive (not deleted during hold or notify)

tlp::node tlp::OLOObject::getNode (  )  const

return the node representing that OLOObject in the OLOGraph

static OLOObject* tlp::OLOObject::getObject ( tlp::node  n  )  [static]

return a pointer on the object represented by that node

Warning:
If you call that function during an update, it is possible that the pointer do not point on an existing object, use the isAlive function before to test if your object still valid
static const tlp::VectorGraph& tlp::OLOObject::getOLOGraph (  )  [static]

Return a reference on the Observable/Listener/Observer graph.

tlp::Iterator<tlp::node>* tlp::OLOObject::getOutObjects (  )  const [protected]

return an iterator on out objects (Listener/Observer), the iterator garantee that all objects are alive (not deleted during hold or notify)

unsigned int tlp::OLOObject::getReceived (  )  const

return the number of received nofication

unsigned int tlp::OLOObject::getSent (  )  const

return the number of sent nofication

static bool tlp::OLOObject::isAlive ( tlp::node  n  )  [static]

Enables to test if the object represented by a node has been deleted. Outside a unhold/hold block or an update that function always return true.

OLOObject& tlp::OLOObject::operator= ( const OLOObject  )  [protected]

Reimplemented in tlp::ColorScale.


Friends And Related Function Documentation

friend class Observable [friend]


Tulip Software by LaBRI Visualization Team    2001 - 2011