8 #define TEMPLATE_TYPEDEF(x, y) \
12 #define TEMPLATE_TYPEDEF(x, y) typedef x y
21 T &operator*() { return *ptr; }
46 ePtr &operator=(ePtr<T> &c)
62 T* grabRef() { if (!ptr) return 0; ptr->AddRef(); return ptr; }
63 T* &ptrref() { assert(!ptr); return ptr; }
64 T* operator->() const { assert(ptr); return ptr; }
65 operator T*() const { return this->ptr; }
75 T &operator*() { return *ptr; }
87 eUsePtr(const eUsePtr &c)
96 eUsePtr &operator=(T *c)
112 eUsePtr &operator=(eUsePtr<T> &c)
137 T* grabRef() { if (!ptr) return 0; ptr->AddRef(); ptr->AddUse(); return ptr; }
138 T* &ptrref() { assert(!ptr); return ptr; }
139 T* operator->() const { assert(ptr); return ptr; }
140 operator T*() const { return this->ptr; }
147 class eMutablePtr: public ePtr<T>
149 /* read doc/iObject about the ePtrHelper */
155 inline ePtrHelper(T1 *obj): m_obj(obj)
163 inline T1* operator->() { return m_obj; }
168 eMutablePtr(): ePtr<T>(0)
172 eMutablePtr(T *c): ePtr<T>(c)
176 eMutablePtr(const eMutablePtr &c): ePtr<T>(c)
180 eMutablePtr &operator=(T *c)
182 ePtr<T>::operator=(c);
187 ePtrHelper<T> operator->() { assert(ptr); return ePtrHelper<T>(ptr); }
189 /* for const objects, we don't need the helper, as they can't */
190 /* be changed outside the program flow. at least this is */
191 /* what the compiler assumes, so in case you're using const */
192 /* eMutablePtrs note that they have to be const. */
193 const T* operator->() const { assert(ptr); return ptr; }