00001
#if !defined (__BRIDGE_HPP)
00002
#define __BRIDGE_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
00043
template <
class Implementation>
00044 class Bridge :
public CoreLinuxObject
00045 {
00046
public:
00047
00053 Bridge( Implementation aImplementation )
00054 :
00055
CoreLinuxObject(),
00056 theImplementation(aImplementation)
00057 {
00058 ;
00059 }
00060
00061
00063
00064 virtual ~Bridge(
void )
00065 {
00066 ;
00067 }
00068
00069
00070
00071
00080 Bridge & operator=(
const Bridge & aRef )
throw(
Exception)
00081 {
00082 this->setImplementation( aRef.getImplementation() );
00083
return (*this);
00084 }
00085
00092 bool operator==(
const Bridge & )
const
00093
{
00094
return (
this == &aRef);
00095 }
00096
00103 bool operator!=(
const Bridge & )
const
00104
{
00105
return !(*
this == aRef);
00106 }
00107
00108
protected:
00109
00117 Bridge(
void ) throw (
Assertion)
00118 {
00119 NEVER_GET_HERE;
00120 }
00121
00131 Bridge(
const Bridge & ) throw (
Assertion)
00132 {
00133 NEVER_GET_HERE;
00134 }
00135
00136
00137
00143 Implementation
getImplementation(
void )
const
00144
{
00145
return theImplementation;
00146 }
00147
00148
00149
00150
00151
00160 void setImplementation( Implementation aImpl )
throw(
Exception)
00161 {
00162 theImplementation = cloneImplementation(aImpl);
00163 }
00164
00165
00174
virtual Implementation cloneImplementation
00175 (
00176 Implementation
00177 )
throw(
Exception) = 0;
00178
00179
private:
00180
00182
00183 Implementation theImplementation;
00184
00185
00186 };
00187
00188 }
00189
00190
#endif // if !defined(__BRIDGE_HPP)
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201