#include <Decorator.h>
Public Member Functions | |
Decorator (T *decorated, bool deleteDecorated=false) | |
Constructor. More... | |
Decorator (const Decorator &rhs) | |
Copy constructor. More... | |
T * | findDecorator (T *decorated) |
Returns the Decorator that decorates this item. More... | |
T * | getDecorated () |
Returns the pointer of decorated object. More... | |
Decorator & | operator= (const Decorator &rhs) |
Copy operator. More... | |
T * | removeDecorator (T *decorated) |
Removes The decorator of the decorated. More... | |
virtual | ~Decorator () |
Virtual destructor. More... | |
Protected Attributes | |
T * | m_decorated |
The object decorated. More... | |
bool | m_delDecorated |
If true, also delete decorated pointer. More... | |
Decorators are classes that can change object behavioral in run-time. For more informations about decorator pattern, see: Decorator pattern on Wikipedia.
Definition at line 42 of file Decorator.h.
te::common::Decorator< T >::Decorator | ( | T * | decorated, |
bool | deleteDecorated = false |
||
) |
Constructor.
The deleteDecorated argument tells if the decorator HAS or NOT the ownership of the decorated pointer. A true value gives the ownership to the decorator and the client do not need manage memory of the decorated pointer. Otherwise, the client needs manage the memory of the decorated pointer.
decorated | The object to be decorated. |
deleteDecorated | Tells to decorator to also delete decorated pointer. |
Definition at line 103 of file Decorator.h.
|
virtual |
Virtual destructor.
Definition at line 111 of file Decorator.h.
te::common::Decorator< T >::Decorator | ( | const Decorator< T > & | rhs | ) |
T * te::common::Decorator< T >::findDecorator | ( | T * | decorated | ) |
Returns the Decorator that decorates this item.
decorated | The decorated item that we are looking for. |
Definition at line 140 of file Decorator.h.
T * te::common::Decorator< T >::getDecorated | ( | ) |
Returns the pointer of decorated object.
Definition at line 134 of file Decorator.h.
Decorator< T > & te::common::Decorator< T >::operator= | ( | const Decorator< T > & | rhs | ) |
Copy operator.
rhs | Object to be copied. |
Definition at line 125 of file Decorator.h.
References te::common::Decorator< T >::m_decorated, and te::common::Decorator< T >::m_delDecorated.
T * te::common::Decorator< T >::removeDecorator | ( | T * | decorated | ) |
Removes The decorator of the decorated.
decorated | The item that we are searching for the decorator. |
Definition at line 154 of file Decorator.h.
References te::common::Decorator< T >::m_decorated, and te::common::Decorator< T >::m_delDecorated.
|
protected |
The object decorated.
Definition at line 98 of file Decorator.h.
Referenced by te::common::Decorator< T >::operator=(), and te::common::Decorator< T >::removeDecorator().
|
protected |
If true, also delete decorated pointer.
Definition at line 99 of file Decorator.h.
Referenced by te::common::Decorator< T >::operator=(), and te::common::Decorator< T >::removeDecorator().