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; }
68 T &operator*() { return *ptr; }
80 eUsePtr(const eUsePtr &c)
89 eUsePtr &operator=(T *c)
105 eUsePtr &operator=(eUsePtr<T> &c)
130 T* grabRef() { if (!ptr) return 0; ptr->AddRef(); ptr->AddUse(); return ptr; }
131 T* &ptrref() { assert(!ptr); return ptr; }
132 T* operator->() const { assert(ptr); return ptr; }
133 operator T*() const { return this->ptr; }
140 class eMutablePtr: public ePtr<T>
142 /* read doc/iObject about the ePtrHelper */
148 inline ePtrHelper(T1 *obj): m_obj(obj)
156 inline T1* operator->() { return m_obj; }
161 eMutablePtr(): ePtr<T>(0)
165 eMutablePtr(T *c): ePtr<T>(c)
169 eMutablePtr(const eMutablePtr &c): ePtr<T>(c)
173 eMutablePtr &operator=(T *c)
175 ePtr<T>::operator=(c);
180 ePtrHelper<T> operator->() { assert(ptr); return ePtrHelper<T>(ptr); }
182 /* for const objects, we don't need the helper, as they can't */
183 /* be changed outside the program flow. at least this is */
184 /* what the compiler assumes, so in case you're using const */
185 /* eMutablePtrs note that they have to be const. */
186 const T* operator->() const { assert(ptr); return ptr; }