#include <ElementOwner.h>
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. | |
ElementOwner * | getOwner (const ElementOwner *outerOwner=NULL) const |
Returns effective owner instance. | |
void | addElement (Element *element) |
Adds the given element as owned by this owner. |
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.
embite::ElementOwner::ElementOwner | ( | ElementOwner * | owner | ) | [protected] |
Creates proxy element owner.
owner | If not NULL specifies instance of a another owner to which ownership will be delegated. |
ElementOwner* embite::ElementOwner::getOwner | ( | const ElementOwner * | outerOwner = NULL |
) | const [inline, protected] |
Returns effective owner instance.
outerOwner | Optional. Convenience parameter allowing to force the owner to be used and |
void embite::ElementOwner::addElement | ( | Element * | element | ) | [protected] |
Adds the given element as owned by this owner.
element | Object which will be owner by this owner. |