it_bus/reflect/complex_value_ref.h

00001 #ifndef _IT_REFLECT_COMPLEX_VALUE_REF_CXX_
00002 #define _IT_REFLECT_COMPLEX_VALUE_REF_CXX_
00003 
00004 // @Copyright 2004 IONA Technologies, Plc. All Rights Reserved.
00005 //
00006 
00007 #include <it_bus/reflect/value_ref_base.h>
00008 
00009 namespace IT_Reflect
00010 {
00016     template <class T>
00017     class ComplexValueRef :
00018         public IT_Reflect::ValueRefBase<T>
00019     {
00020       public:
00024         ComplexValueRef(
00025             const T& value
00026         ) IT_THROW_DECL(());
00027 
00031         ComplexValueRef(
00032             const T* value
00033         ) IT_THROW_DECL(());
00034 
00038         ~ComplexValueRef() IT_THROW_DECL(());
00039         
00044         virtual const IT_Bus::AnyType& 
00045         get_reflected() const IT_THROW_DECL(());
00046 
00051         virtual IT_Bus::AnyType& 
00052         get_reflected() IT_THROW_DECL(());
00053 
00059         virtual IT_Bus::AnyType*
00060             clone() const IT_THROW_DECL((ReflectException));
00061     };
00062 
00063 
00064     // Template function definitions
00065     //
00066     
00067     template <class T>
00068     ComplexValueRef<T>::ComplexValueRef(
00069         const T& value
00070     ) IT_THROW_DECL(())
00071         :
00072         ValueRefBase<T>(IT_CONST_CAST(T*, &value))
00073     {
00074         // Complete.
00075     }
00076 
00077     template <class T>
00078     ComplexValueRef<T>::ComplexValueRef(
00079         const T* value
00080     ) IT_THROW_DECL(())
00081         :
00082         ValueRefBase<T>(IT_CONST_CAST(T*, value))
00083     {
00084         // Complete.
00085     }
00086 
00087     template <class T>
00088     ComplexValueRef<T>::~ComplexValueRef() IT_THROW_DECL(())
00089     {
00090         // Complete
00091     }
00092     
00093     template <class T>
00094     const IT_Bus::AnyType& 
00095     ComplexValueRef<T>::get_reflected() const IT_THROW_DECL(())
00096     {
00097         return *this->m_value;
00098     }
00099 
00100     template <class T>
00101     IT_Bus::AnyType& 
00102     ComplexValueRef<T>::get_reflected() IT_THROW_DECL(())
00103     {
00104         return *this->m_value;
00105     }
00106 
00107     template <class T>
00108     IT_Bus::AnyType*
00109     ComplexValueRef<T>::clone() const
00110         IT_THROW_DECL((ReflectException))
00111     {
00112         return new T(*this->m_value);
00113     }
00114 }
00115 
00116 #endif  

Generated on Thu Sep 7 11:39:00 2006 for Artix by  doxygen 1.4.7