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; }
72 class eMutablePtr: public ePtr<T>
74 /* read doc/iObject about the ePtrHelper */
80 inline ePtrHelper(T1 *obj): m_obj(obj)
88 inline T1* operator->() { return m_obj; }
93 eMutablePtr(): ePtr<T>(0)
97 eMutablePtr(T *c): ePtr<T>(c)
101 eMutablePtr(const eMutablePtr &c): ePtr<T>(c)
105 eMutablePtr &operator=(T *c)
107 ePtr<T>::operator=(c);
112 ePtrHelper<T> operator->() { assert(ptr); return ePtrHelper<T>(ptr); }
114 /* for const objects, we don't need the helper, as they can't */
115 /* be changed outside the program flow. at least this is */
116 /* what the compiler assumes, so in case you're using const */
117 /* eMutablePtrs note that they have to be const. */
118 const T* operator->() const { assert(ptr); return ptr; }