00001
#if !defined (__DECORATOR_HPP)
00002
#define __DECORATOR_HPP
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
#if !defined(__COMMON_HPP)
00025
#include <Common.hpp>
00026
#endif
00027
00028
00029
namespace corelinux
00030 {
00031
00038
template <
class Implementation>
00039 class Decorator :
public CoreLinuxObject
00040 {
00041
public:
00042
00043
00044
00045
00046
00052 Decorator( Implementation aImplementation )
00053 :
00054
CoreLinuxObject(),
00055 theImplementation(aImplementation)
00056 {
00057 ;
00058 }
00059
00065 Decorator(
const Decorator &aDecorator )
00066 :
00067
CoreLinuxObject(),
00068 theImplementation
00069 (
00070 aDecorator.getImplementation()
00071 )
00072 {
00073 ;
00074 }
00075
00077
00078 virtual ~Decorator(
void )
00079 {
00080 ;
00081 }
00082
00083
00084
00085
00094 Decorator & operator=(
const Decorator & aDecorator )
00095
throw(
Exception)
00096 {
00097 this->setImplementation
00098 ( aDecorator.getImplementation() );
00099
00100
return (*this);
00101 }
00102
00109 bool operator==(
const Decorator & aDecorator )
const
00110
{
00111
return
00112 (
00113
this == &aDecorator &&
00114 (
00115 this->
getImplementation() ==
00116 aDecorator.
getImplementation()
00117 )
00118 );
00119 }
00120
00121
00122
00123
00124
00130 virtual Implementation
getImplementation(
void )
const
00131
{
00132
return theImplementation;
00133 }
00134
00135
00136
00137
00138
00144 virtual void setImplementation( Implementation aImplementation )
00145
throw(
Exception)
00146 {
00147 theImplementation = aImplementation;
00148 }
00149
00150
protected:
00151
00152
00153
00154
00155
00163 Decorator(
void )
00164 throw (
Assertion)
00165 :
00166
CoreLinuxObject()
00167 {
00168 NEVER_GET_HERE;
00169 }
00170
00171
00172
protected:
00173
00175
00176 Implementation theImplementation;
00177
00178
00179 };
00180
00181 }
00182
00183
#endif // if !defined(__DECORATOR_HPP)
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195