#include <Decorator.h>
Public Member Functions | |
Decorator (T *decorated, bool deleteDecorated=false) | |
Constructor. More... | |
Decorator (const Decorator &rhs) | |
Copy constructor. More... | |
T * | getDecorated () |
Returns the pointer of decorated object. More... | |
Decorator & | operator= (const Decorator &rhs) |
Copy operator. 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 87 of file Decorator.h.
|
virtual |
Virtual destructor.
Definition at line 95 of file Decorator.h.
te::common::Decorator< T >::Decorator | ( | const Decorator< T > & | rhs | ) |
T * te::common::Decorator< T >::getDecorated | ( | ) |
Returns the pointer of decorated object.
Definition at line 118 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 109 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 82 of file Decorator.h.
Referenced by te::common::Decorator< T >::operator=().
|
protected |
If true, also delete decorated pointer.
Definition at line 83 of file Decorator.h.
Referenced by te::common::Decorator< T >::operator=().