6 #include <lib/python/swig.h>
14 T &operator*() { return *ptr; }
39 ePtr &operator=(ePtr<T> &c)
55 T* grabRef() { if (!ptr) return 0; ptr->AddRef(); return ptr; }
56 T* &ptrref() { assert(!ptr); return ptr; }
57 T* operator->() const { assert(ptr); return ptr; }
58 operator T*() const { return this->ptr; }
60 operator bool() const { return !!this->ptr; }
70 T &operator*() { return *ptr; }
82 eUsePtr(const eUsePtr &c)
91 eUsePtr &operator=(T *c)
107 eUsePtr &operator=(eUsePtr<T> &c)
132 T* grabRef() { if (!ptr) return 0; ptr->AddRef(); ptr->AddUse(); return ptr; }
133 T* &ptrref() { assert(!ptr); return ptr; }
134 T* operator->() const { assert(ptr); return ptr; }
135 operator T*() const { return this->ptr; }
142 class eMutablePtr: public ePtr<T>
144 /* read doc/iObject about the ePtrHelper */
150 inline ePtrHelper(T1 *obj): m_obj(obj)
158 inline T1* operator->() { return m_obj; }
163 eMutablePtr(): ePtr<T>(0)
167 eMutablePtr(T *c): ePtr<T>(c)
171 eMutablePtr(const eMutablePtr &c): ePtr<T>(c)
175 eMutablePtr &operator=(T *c)
177 ePtr<T>::operator=(c);
182 ePtrHelper<T> operator->() { assert(ptr); return ePtrHelper<T>(ptr); }
184 /* for const objects, we don't need the helper, as they can't */
185 /* be changed outside the program flow. at least this is */
186 /* what the compiler assumes, so in case you're using const */
187 /* eMutablePtrs note that they have to be const. */
188 const T* operator->() const { assert(ptr); return ptr; }