1 #ifndef CORE_Pointers_H
2 #define CORE_Pointers_H
39 #include <boost/shared_array.hpp>
40 #include <boost/shared_ptr.hpp>
41 #include <boost/weak_ptr.hpp>
42 #include <boost/enable_shared_from_this.hpp>
112 #define NAME_SPACE_SPTR(X) \
113 namespace SharedPointer \
117 namespace WeakPointer \
121 namespace SharedPointerConst \
123 typedef SPtrConst##X X;\
125 namespace WeakPointerConst \
127 typedef WPtrConst##X X; \
130 #define NAME_SPACE_SVPTR(X) \
131 namespace SharedVector \
133 typedef SVPtr##X X; \
135 namespace SharedVectorConst \
137 typedef SVPtrConst##X X; \
139 namespace WeakVector \
141 typedef WVPtr##X X; \
143 namespace WeakVectorConst \
145 typedef WVPtrConst##X X; \
150 #define TYPEDEF_SPTR(X) \
151 typedef boost::weak_ptr<X> WPtr##X; \
152 typedef boost::shared_ptr<X> SPtr##X; \
153 typedef boost::shared_ptr<const X> SPtrConst##X; \
154 typedef boost::weak_ptr<const X> WPtrConst##X; \
158 #define TYPEDEF_SAPTR(X) \
159 typedef boost::shared_array<X> X##SAPtr ; \
164 #define DEFINE_SPTR(X) \
169 #define DEFINE_SAPTR(X) \
173 #define USE_THIS(X,Y)\
176 #define SP_OBJECT(X)\
180 void getSharedPointer(SP::X& p){\
182 CORE_Object::getSharedPointer(r); \
183 p=boost::dynamic_pointer_cast<X>(r); \
187 void getSharedPointer(SPC::X& p) const{ \
189 CORE_Object::getSharedPointer(r); \
190 p=boost::dynamic_pointer_cast<const X>(r); \
195 inline SP::X getThis() { \
197 getSharedPointer(p);\
202 inline SPC::X getThis() const { \
204 getSharedPointer(p); \
212 template<
class T,
class U>
213 static boost::shared_ptr<T> dynamic_sp_cast(boost::shared_ptr<U>
const & r) {
214 return boost::dynamic_pointer_cast<T>(r);
Definition: CORE_Pointers.h:55
Definition: CORE_Pointers.h:50
void operator()(void const *) const
return the default nullDeleter
Definition: CORE_Pointers.h:106
Definition: CORE_Pointers.h:52
file CORE_Pointers.hpp CORE interface to reference-counting pointers
Definition: CORE_Pointers.h:46
Definition: CORE_Pointers.h:54
Definition: CORE_Pointers.h:49
Definition: CORE_Pointers.h:53
Definition: CORE_Pointers.h:48
Definition: CORE_Pointers.h:47
Definition: CORE_Pointers.h:102