it_bus/nillable_value.h

00001 #ifndef _IT_BUS_NILLABLE_VALUE_H_
00002 #define _IT_BUS_NILLABLE_VALUE_H_
00003 
00004 // @Copyright 2003 IONA Technologies, Plc. All Rights Reserved.
00005 //
00006 
00007 #include <it_bus/any_type.h>
00008 #include <it_bus/nillable.h>
00009 #include <it_bus/nillable_value_base.h>
00010 
00011 namespace IT_Bus
00012 {
00024     template <class T>
00025     class NillableValue : public NillableValueBase<T>
00026     {
00027       public:
00028         NillableValue();
00029 
00030         IT_EXPLICIT NillableValue(
00031             const T& other
00032         );
00033 
00034         IT_EXPLICIT NillableValue(
00035             const T *other
00036         );
00037 
00038         virtual ~NillableValue();
00039 
00040         NillableValue&
00041         operator=(
00042             const NillableValue& other
00043         );
00044 
00045         virtual IT_Reflect::Reflection*
00046         get_reflection()
00047             throw((IT_Reflect::ReflectException));
00048 
00049         virtual const IT_Reflect::Reflection*
00050         get_reflection() const
00051             throw((IT_Reflect::ReflectException));
00052 
00053         virtual AnyType&
00054         copy(
00055             const AnyType& other
00056         );
00057 
00058         virtual const QName&
00059         get_type() const;
00060 
00061         NillableValue&
00062         operator=(
00063             const T& rhs
00064         );
00065         
00066         NillableValue&
00067         operator=(
00068             const T *rhs
00069         );
00070     };
00071 
00072     template <class T>
00073     NillableValue<T>::NillableValue() 
00074     {
00075         // Complete.
00076     }
00077 
00078     template <class T>
00079     NillableValue<T>::NillableValue(
00080         const T& data
00081     ) : NillableValueBase<T>(data)
00082     {
00083         // Complete.
00084     }
00085     
00086     template <class T>
00087     NillableValue<T>::NillableValue(
00088         const T *data
00089     ) : NillableValueBase<T>(data)
00090     {
00091         // Complete.
00092     }
00093 
00094     template <class T>
00095     const QName&
00096     NillableValue<T>::get_type() const
00097     {
00098         return T::get_static_type();
00099     }
00100 
00101     template <class T>
00102     NillableValue<T>::~NillableValue()
00103     {
00104         //Complete
00105     }
00106 
00107     template <class T>
00108     NillableValue<T>&
00109     NillableValue<T>::operator=(
00110         const NillableValue<T>& other
00111     ) 
00112     {
00113         NillableValueBase<T>::operator=(other);
00114         return *this;
00115     }
00116 
00117     template <class T>
00118     IT_Reflect::Reflection*
00119     NillableValue<T>::get_reflection()
00120         throw((IT_Reflect::ReflectException))
00121     {
00122         return this->is_nil() ? 0 : this->get().get_reflection();
00123     }
00124     
00125     template <class T>
00126     const IT_Reflect::Reflection*
00127     NillableValue<T>::get_reflection() const
00128         throw((IT_Reflect::ReflectException))
00129     {
00130         return IT_CONST_CAST(NillableValue<T>*, this)->get_reflection();
00131     }
00132 
00133     template <class T>
00134     AnyType&
00135     NillableValue<T>::copy(
00136         const AnyType& rhs
00137     ) 
00138     {
00139         NillableValueBase<T>::copy(rhs);
00140         return *this;
00141     }
00142 
00143     template <class T>
00144     NillableValue<T>&
00145     NillableValue<T>::operator=(
00146         const T& rhs
00147     )
00148     {
00149         NillableValue<T>::set(rhs);
00150         return *this;
00151     }
00152 
00153     template <class T>
00154     NillableValue<T>&
00155     NillableValue<T>::operator=(
00156         const T *rhs
00157     )
00158     {
00159         NillableValue<T>::set(rhs);
00160         return *this;
00161     }
00162 }
00163 
00164 #endif  

Generated on Tue Mar 20 15:27:42 2007 for Artix by  doxygen 1.5.1-p1