it_bus/reflect/reflected_nillable_ptr.h

00001 #ifndef _IT_BUS_REFLECTED_NILLABLE_PTR_H_
00002 #define _IT_BUS_REFLECTED_NILLABLE_PTR_H_
00003 
00004 // @Copyright 2003 IONA Technologies, Plc. All Rights Reserved.
00005 //
00006 
00007 #include <it_bus/nillable_ptr.h>
00008 #include <it_bus/reflect/nillable_ptr_impl_t.h>
00009 
00010 namespace IT_Reflect
00011 {
00015     template <class T>
00016     class ReflectedNillablePtr : public IT_Bus::NillablePtr<T>
00017     {
00018         
00019       public:
00020         typedef IT_Reflect::NillablePtrImplT<ReflectedNillablePtr<T>, T>
00021         IT_ReflectionType;
00022         
00026         ReflectedNillablePtr();
00027 
00031         ReflectedNillablePtr(
00032             const ReflectedNillablePtr& other
00033         );
00034 
00038         IT_EXPLICIT ReflectedNillablePtr(
00039             T* data
00040         );
00041         
00045         virtual IT_Reflect::Reflection*
00046         get_reflection() IT_THROW_DECL(());
00047 
00051         virtual const IT_Reflect::Reflection*
00052         get_reflection() const IT_THROW_DECL(());
00053 
00054       private:
00055         typedef ReflectedNillablePtr ThisType; // needed for DYNAMIC_CAST macro
00056     };
00057 
00058 
00059     template <class T>
00060     ReflectedNillablePtr<T>::ReflectedNillablePtr() 
00061     {
00062         // Complete.
00063     }
00064 
00065     template <class T>
00066     ReflectedNillablePtr<T>::ReflectedNillablePtr(
00067         const ReflectedNillablePtr<T>& other
00068     ) 
00069         :
00070         IT_Bus::NillablePtr<T>(other)
00071     {
00072         // Complete.
00073     }
00074 
00075     template <class T>
00076     ReflectedNillablePtr<T>::ReflectedNillablePtr(
00077         T* data
00078     ) 
00079         :
00080         IT_Bus::NillablePtr<T>(data)
00081     {
00082         // Complete.
00083     }
00084 
00085     template <class T>
00086     IT_Reflect::Reflection*
00087     ReflectedNillablePtr<T>::get_reflection() IT_THROW_DECL(())
00088     {
00089         return new IT_ReflectionType(this);
00090     }
00091 
00092     template <class T>
00093     const IT_Reflect::Reflection*
00094     ReflectedNillablePtr<T>::get_reflection() const IT_THROW_DECL(())
00095     {
00096         return new IT_ReflectionType(this);
00097     }
00098 }
00099 
00100 #endif  

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