CoreLinux++  0.4.32
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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.
 
Decoratoroperator= (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

 Decorator (void) 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

§ Decorator() [1/3]

template<class Implementation >
corelinux::Decorator< Implementation >::Decorator ( Implementation  aImplementation)
inline

Default Constructor requires a Implementation.

Parameters
Implementationinstance

§ Decorator() [2/3]

template<class Implementation >
corelinux::Decorator< Implementation >::Decorator ( const Decorator< Implementation > &  aDecorator)
inline

Copy Constructor copies theImplementation.

Parameters
Decoratorconst reference

§ Decorator() [3/3]

template<class Implementation >
corelinux::Decorator< Implementation >::Decorator ( void  )
throw (Assertion
)
inlineprotected

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

Parameters
void
Exceptions
NEVER_GET_HERE

Member Function Documentation

§ getImplementation()

template<class Implementation >
virtual Implementation corelinux::Decorator< Implementation >::getImplementation ( void  ) const
inlinevirtual

Gets current theImplementation.

Returns
Implementation instance

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

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

§ 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
Decoratorconst reference
Returns
Decorator reference to self
Exceptions
Exception- implementation defined

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

§ operator==()

template<class Implementation >
bool corelinux::Decorator< Implementation >::operator== ( const Decorator< Implementation > &  aDecorator) const
inline

Equality operator overload.

Parameters
Decoratorconst reference
Returns
true if equal, false otherwise

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

§ setImplementation()

template<class Implementation >
virtual void corelinux::Decorator< Implementation >::setImplementation ( Implementation  aImplementation)
throw (Exception
)
inlinevirtual

Sets current theImplementation to aImplementation.

Parameters
Implementation- implementation instance
Exceptions
Exception- derivation defined

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

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


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

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