00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00023
00033
00034
00035 #ifndef _XST_STORAGE_ADAPTOR_H_INCLUDED_
00036 #define _XST_STORAGE_ADAPTOR_H_INCLUDED_
00037
00038 namespace cttl_impl {
00039
00047 template< typename ValueT >
00048 class xst_storage_adaptor
00049 {
00050 private:
00052 ValueT m_value;
00053
00054 public:
00056 typedef ValueT value_type;
00057
00059 typedef ValueT& reference;
00060
00062 typedef ValueT const& const_reference;
00063
00065 xst_storage_adaptor()
00066 :
00067 m_value( ValueT() )
00068 {
00069 }
00070
00072 xst_storage_adaptor( ValueT const& value_ )
00073 :
00074 m_value( value_ )
00075 {
00076 }
00077
00079 xst_storage_adaptor( xst_storage_adaptor< ValueT > const& other_ )
00080 :
00081 m_value( other_.m_value )
00082 {
00083 }
00084
00086 void operator=( xst_storage_adaptor< ValueT > const& ) const
00087 {
00088 }
00089
00091 const_reference const_value() const
00092 {
00093 return m_value;
00094 }
00095
00097 reference value()
00098 {
00099 return m_value;
00100 }
00101
00103 static char trace_char()
00104 {
00105 return '_';
00106 }
00107
00108 };
00109
00110
00118 template< typename ValueT >
00119 class xst_storage_adaptor< ValueT& >
00120 {
00121 private:
00123 ValueT& m_value;
00124
00125 public:
00127 typedef ValueT value_type;
00128
00130 typedef ValueT& reference;
00131
00133 typedef ValueT const& const_reference;
00134
00136 xst_storage_adaptor( ValueT& value_ )
00137 :
00138 m_value( value_ )
00139 {
00140 }
00141
00143 void operator=( xst_storage_adaptor< ValueT& > const& ) const
00144 {
00145 }
00146
00148 const_reference const_value() const
00149 {
00150 return m_value;
00151 }
00152
00154 reference value() const
00155 {
00156 return m_value;
00157 }
00158
00160 static char trace_char()
00161 {
00162 return ' ';
00163 }
00164
00165 };
00166
00167
00175 template< typename ValueT >
00176 class xst_storage_adaptor< ValueT const& >
00177 {
00178 private:
00180 ValueT const& m_value;
00181
00182 public:
00184 typedef ValueT value_type;
00185
00187 typedef ValueT& reference;
00188
00190 typedef ValueT const& const_reference;
00191
00193 xst_storage_adaptor( ValueT const& value_ )
00194 :
00195 m_value( value_ )
00196 {
00197 }
00198
00200 void operator=( xst_storage_adaptor< ValueT const& > const& ) const
00201 {
00202 }
00203
00205 const_reference const_value() const
00206 {
00207 return m_value;
00208 }
00209
00211 const_reference value() const
00212 {
00213 return m_value;
00214 }
00215
00217 static char trace_char()
00218 {
00219 return '&';
00220 }
00221
00222 };
00223
00224
00225 }
00226
00227 #endif // _XST_STORAGE_ADAPTOR_H_INCLUDED_