Go to the documentation of this file.00001 #ifndef SMARTSERVANTPOINTER_H
00002 #define SMARTSERVANTPOINTER_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00033 #include "lokiSmartPtr.h"
00034
00035 namespace baci
00036 {
00037
00045 template <class T> class CORBAServantSPStorage:
00046 public Loki::DefaultSPStorage<T>
00047 {
00048 public:
00054 typedef T* StoredType;
00058 CORBAServantSPStorage() : Loki::DefaultSPStorage<T>()
00059 {}
00060
00061
00062
00063 CORBAServantSPStorage(const CORBAServantSPStorage& st) :
00064 Loki::DefaultSPStorage<T>(st)
00065 {}
00066
00067 template <class U>
00068 CORBAServantSPStorage(const CORBAServantSPStorage<U>& st) :
00069 Loki::DefaultSPStorage<U>(st)
00070 {}
00071
00072 CORBAServantSPStorage(const StoredType& p) :
00073 Loki::DefaultSPStorage<T>(p) {}
00074
00075
00076 protected:
00077
00078
00079 void Destroy()
00080 {
00081 if(GetImpl(*this) != 0)
00082 {
00083 (*this)->destroy();
00084 }
00085 }
00086 };
00087
00088 template<class T>
00089 class SmartServantPointer: public Loki::SmartPtr<
00090 T,
00091 Loki::RefCounted,
00092 Loki::AllowConversion,
00093 Loki::AssertCheck,
00094 CORBAServantSPStorage
00095 >
00096 {
00097 public:
00098 SmartServantPointer();
00099 SmartServantPointer(T* prop);
00100 };
00101
00102 }
00103
00104 #include "baciSmartServantPointer.i"
00105
00106 #endif