25 #ifndef _CSELFDESTROYPOINTER
26 #define _CSELFDESTROYPOINTER
27 #include "libMRML/include/uses-declarations.h"
34 mutable bool mIsSelfDestroyer;
41 void resetWithoutDeleting();
43 inline bool isSelfDestroyer()
const;
45 inline void setIsSelfDestroyer(
bool inisSelfDestroyer=
true)
const;
47 void unsetIsSelfDestroyer()
const;
49 T* operator= (T* inPointer);
53 T
const& operator*()
const;
57 T
const* operator -> ()
const;
65 inSelfDestroyPointer);
85 #ifdef _DEBUG_SELF_DESTROY_
115 bool inIsSelfDestroyer):
117 mIsSelfDestroyer(inIsSelfDestroyer)
123 mPointer(in.mPointer),
124 mIsSelfDestroyer(in.mIsSelfDestroyer)
131 mIsSelfDestroyer(true)
138 if(mIsSelfDestroyer){
147 mIsSelfDestroyer= inIsSelfDestroyer;
152 return mIsSelfDestroyer;
173 mutable bool mIsSelfCloner;
188 operator bool()
const;
205 this->mPointer=in.mPointer;
206 setIsSelfDestroyer(in.isSelfDestroyer());
226 if(in.mPointer && in.isSelfDestroyer()){
227 this->mPointer=in.mPointer->clone();
229 this->mPointer=in.mPointer;
Definition: CSelfDestroyPointer.h:171
destroys the element it points to or not (depending on user's choice).
Definition: CSelfDestroyPointer.h:32