#include <Decorator.h>
Public Member Functions | |
| Decorator (const Decorator &rhs) | |
| Copy constructor. | |
| Decorator (T *decorated, bool deleteDecorated=false) | |
| Constructor. | |
| T * | findDecorator (T *decorated) |
| Returns the Decorator that decorates this item. | |
| T * | getDecorated () |
| Returns the pointer of decorated object. | |
| Decorator & | operator= (const Decorator &rhs) |
| Copy operator. | |
| T * | removeDecorator (T *decorated) |
| Removes The decorator of the decorated. | |
| virtual | ~Decorator () |
| Virtual destructor. | |
Protected Attributes | |
| T * | m_decorated |
| The object decorated. | |
| bool | m_delDecorated |
| If true, also delete decorated pointer. | |
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.
References m_decorated, and m_delDecorated.
Referenced by Decorator(), findDecorator(), operator=(), and removeDecorator().
|
virtual |
Virtual destructor.
Definition at line 111 of file Decorator.h.
References m_decorated, and m_delDecorated.
| te::common::Decorator< T >::Decorator | ( | const Decorator< T > & | rhs | ) |
Copy constructor.
| rhs | Object to be copied. |
Definition at line 118 of file Decorator.h.
References Decorator(), m_decorated, and m_delDecorated.
| 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.
References Decorator(), findDecorator(), and m_decorated.
Referenced by findDecorator(), and removeDecorator().
| T * te::common::Decorator< T >::getDecorated | ( | ) |
Returns the pointer of decorated object.
Definition at line 134 of file Decorator.h.
References m_decorated.
| 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 Decorator(), m_decorated, and 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 Decorator(), findDecorator(), m_decorated, and m_delDecorated.
|
protected |
The object decorated.
Definition at line 98 of file Decorator.h.
Referenced by Decorator(), Decorator(), findDecorator(), getDecorated(), operator=(), removeDecorator(), and ~Decorator().
|
protected |
If true, also delete decorated pointer.
Definition at line 99 of file Decorator.h.
Referenced by Decorator(), Decorator(), operator=(), removeDecorator(), and ~Decorator().