corelinux::Decorator< Implementation > Class Template Reference

Decorators can attach additional responsibilities to an object dynamically which provide a more flexible alternative to subclassing for extending functionality. More...

`#include <Decorator.hpp>`

## Public Member Functions

| Decorator (Implementation aImplementation)
| Default Constructor requires a Implementation. More...
| Decorator (const Decorator &aDecorator)
| Copy Constructor copies theImplementation. More...
virtual | ~Decorator (void)
| Virtual Destructor.
Decorator & | operator= (const Decorator &aDecorator) throw (Exception)
| Assignment operator overload. More...
bool | operator== (const Decorator &aDecorator) const
| Equality operator overload. More...
virtual Implementation | getImplementation (void) const
| Gets current theImplementation. More...
virtual void | setImplementation (Implementation aImplementation) throw (Exception)
| Sets current theImplementation to aImplementation. More...
Public Member Functions inherited from corelinux::CoreLinuxObject
| CoreLinuxObject (void)
| Default Constructor.
| CoreLinuxObject (CoreLinuxObjectCref)
| Copy Constructor. More...
virtual | ~CoreLinuxObject (void)
| Virtual Destructor.
CoreLinuxObjectRef | operator= (CoreLinuxObjectCref)
| Assignment operator overload. More...
bool | operator== (CoreLinuxObjectCref) const
| Equality operator overload. More...
bool | operator!= (CoreLinuxObjectCref) const
| Non-equality operator overload. More...

## Protected Member Functions

| throw (Assertion)

    Default Constructor

Because a Decorator requires a implementation to work, you can not construct one without it. More...

## Protected Attributes

Implementation | theImplementation
| Storage for theImplementation object.

## Detailed Description

### template<class Implementation>
class corelinux::Decorator< Implementation >

Decorators can attach additional responsibilities to an object dynamically which provide a more flexible alternative to subclassing for extending functionality.

## Constructor & Destructor Documentation

template<class Implementation >

corelinux::Decorator< Implementation >::Decorator | ( | Implementation | aImplementation | ) |

inline

Default Constructor requires a Implementation.

Parameters

  Implementation | instance

template<class Implementation >

corelinux::Decorator< Implementation >::Decorator | ( | const Decorator< Implementation > & | aDecorator | ) |

inline

Copy Constructor copies theImplementation.

Parameters

  Decorator | const reference

## Member Function Documentation

template<class Implementation >

virtual Implementation corelinux::Decorator< Implementation >::getImplementation | ( | void |  | ) | const

inline virtual

Gets current theImplementation.

Returns
  Implementation instance

References corelinux::Decorator< Implementation >::theImplementation.

Referenced by corelinux::Decorator< Implementation >::operator==().

template<class Implementation >

Decorator& corelinux::Decorator< Implementation >::operator= | ( | const Decorator< Implementation > & | aDecorator | ) |
throw | ( | Exception
| ) |  |

inline

Assignment operator overload.

This may throw Exception if there is a problem cloning theImplementation.

Parameters

  Decorator | const reference

Returns
  Decorator reference to self

Exceptions

  Exception | - implementation defined

References corelinux::Decorator< Implementation >::setImplementation().

template<class Implementation >

bool corelinux::Decorator< Implementation >::operator== | ( | const Decorator< Implementation > & | aDecorator | ) | const

inline

Equality operator overload.

Parameters

  Decorator | const reference

Returns
  true if equal, false otherwise

References corelinux::Decorator< Implementation >::getImplementation().

template<class Implementation >

virtual void corelinux::Decorator< Implementation >::setImplementation | ( | Implementation | aImplementation | ) |
throw | ( | Exception
| ) |  |

inline virtual

Sets current theImplementation to aImplementation.

Parameters

  Implementation | - implementation instance

Exceptions

  Exception | - derivation defined

References corelinux::Decorator< Implementation >::theImplementation.

Referenced by corelinux::Decorator< Implementation >::operator=().

template<class Implementation >

corelinux::Decorator< Implementation >::throw | ( | Assertion |  | ) |

inline protected

    Default Constructor

Because a Decorator requires a implementation to work, you can not construct one without it.

Parameters

  void |

Exceptions

  NEVER_GET_HERE |

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

- Decorator.hpp

This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium