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> 122 #define NAME_SPACE_SPTR(X) \ 123 namespace SharedPointer \ 127 namespace WeakPointer \ 131 namespace SharedPointerConst \ 133 typedef SPtrConst##X X;\ 135 namespace WeakPointerConst \ 137 typedef WPtrConst##X X; \ 140 #define NAME_SPACE_SVPTR(X) \ 141 namespace SharedVector \ 143 typedef SVPtr##X X; \ 145 namespace SharedVectorConst \ 147 typedef SVPtrConst##X X; \ 149 namespace SharedArray \ 151 typedef SAPtr##X X; \ 153 namespace SharedArrayConst \ 155 typedef SAPtrConst##X X; \ 157 namespace WeakVector \ 159 typedef WVPtr##X X; \ 161 namespace WeakVectorConst \ 163 typedef WVPtrConst##X X; \ 165 namespace WeakArray \ 167 typedef WAPtr##X X; \ 169 namespace WeakArrayConst \ 171 typedef WAPtrConst##X X; \ 177 #define TYPEDEF_SPTR(X) \ 178 typedef boost::weak_ptr<X> WPtr##X; \ 179 typedef boost::shared_ptr<X> SPtr##X; \ 180 typedef boost::shared_ptr<const X> SPtrConst##X; \ 181 typedef boost::weak_ptr<const X> WPtrConst##X; \ 185 #define TYPEDEF_SAPTR(X) \ 186 typedef boost::shared_array<X> X##SAPtr ; \ 191 #define DEFINE_SPTR(X) \ 196 #define DEFINE_SAPTR(X) \ 200 #define USE_THIS(X,Y)\ 203 #define SP_OBJECT(X)\ 207 void getSharedPointer(SP::X& p){\ 209 CORE_Object::getSharedPointer(r); \ 210 p=boost::dynamic_pointer_cast<X>(r); \ 214 void getSharedPointer(SPC::X& p) const{ \ 216 CORE_Object::getSharedPointer(r); \ 217 p=boost::dynamic_pointer_cast<const X>(r); \ 222 inline SP::X getThis() { \ 224 getSharedPointer(p);\ 229 inline SPC::X getThis() const { \ 231 getSharedPointer(p); \ 239 template<
class T,
class U>
240 static boost::shared_ptr<T> dynamic_sp_cast(boost::shared_ptr<U>
const & r) {
241 return boost::dynamic_pointer_cast<T>(r);
Definition: CORE_Pointers.h:55
Definition: CORE_Pointers.h:59
Definition: CORE_Pointers.h:50
Definition: CORE_Pointers.h:56
file CORE_Pointers.hpp CORE interface to reference-counting pointers
Definition: CORE_Pointers.h:46
Definition: CORE_Pointers.h:52
Definition: CORE_Pointers.h:58
Definition: CORE_Pointers.h:49
Definition: CORE_Pointers.h:57
void operator()(void const *) const
return the default nullDeleter
Definition: CORE_Pointers.h:116
Definition: CORE_Pointers.h:54
Definition: CORE_Pointers.h:48
Definition: CORE_Pointers.h:47
Definition: CORE_Pointers.h:51
Definition: CORE_Pointers.h:112