embite::ElementOwner Class Reference

Controls lifetime of Element objects. More...

#include <ElementOwner.h>

Inheritance diagram for embite::ElementOwner:

embite::Element

List of all members.

Public Member Functions

 ~ElementOwner ()
 Destroys all owned Elements if this is the real owner object.
 ElementOwner ()
 Creates new element owner The created owner will be the root in the owners chain and will control all other objects lifetime.

Protected Member Functions

 ElementOwner (ElementOwner *owner)
 Creates proxy element owner.
ElementOwnergetOwner (const ElementOwner *outerOwner=NULL) const
 Returns effective owner instance.
void addElement (Element *element)
 Adds the given element as owned by this owner.


Detailed Description

Controls lifetime of Element objects.

Dynamically created elements need to have an owner which is reponsible for their lefetime. It is not nesessary that the owner is part of the element tree. However all elements in an element tree must have one and the same owner. Thus once an element is assigned an owner, this owner is used for all subsequently created elements. An element may not have an owner, in this case it becomes owner of itself and is in the beginning of the owner chain.


Constructor & Destructor Documentation

embite::ElementOwner::ElementOwner ( ElementOwner owner  )  [protected]

Creates proxy element owner.

Parameters:
owner If not NULL specifies instance of a another owner to which ownership will be delegated.
When other owner is specified, all calls are proxied to it. Otherwise this object will be root of the owner chain.


Member Function Documentation

ElementOwner* embite::ElementOwner::getOwner ( const ElementOwner outerOwner = NULL  )  const [inline, protected]

Returns effective owner instance.

Parameters:
outerOwner Optional. Convenience parameter allowing to force the owner to be used and
Returns:
The instance of the owner object which is to be used for creation of new elements suppress the lookup in the current object and the upper chain.

void embite::ElementOwner::addElement ( Element element  )  [protected]

Adds the given element as owned by this owner.

Parameters:
element Object which will be owner by this owner.


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

Generated on Thu Mar 12 19:13:00 2009 for embite by  doxygen 1.5.6