13 #ifndef __BERRY_WEAK_POINTER_H__
14 #define __BERRY_WEAK_POINTER_H__
35 template<
class TObjectType>
53 m_Pointer(dynamic_cast<
ObjectType*>(sptr.GetPointer()))
58 &WeakPointer::ObjectDestroyed));
65 m_Pointer(dynamic_cast<
ObjectType*>(p.m_Pointer))
69 &WeakPointer::ObjectDestroyed));
74 m_Pointer(p.m_Pointer)
78 &WeakPointer::ObjectDestroyed));
86 &WeakPointer::ObjectDestroyed));
91 &WeakPointer::ObjectDestroyed));
100 &WeakPointer::ObjectDestroyed));
102 this->m_Pointer = other.m_Pointer;
105 &WeakPointer::ObjectDestroyed));
110 template<
class Other>
115 &WeakPointer::ObjectDestroyed));
117 this->m_Pointer =
const_cast<ObjectType*
>(other.m_Pointer);
120 &WeakPointer::ObjectDestroyed));
129 return (m_Pointer ==
nullptr ? o ==
nullptr : (o && m_Pointer->operator==(o)));
135 const R* o = r.m_Pointer;
136 return (m_Pointer ==
nullptr ? o ==
nullptr : (o && m_Pointer->operator==(o)));
142 return (
void*) m_Pointer < (
void*) r.m_Pointer;
156 &WeakPointer::ObjectDestroyed));
163 return m_Pointer ==
nullptr;
171 &WeakPointer::ObjectDestroyed));
181 void ObjectDestroyed()
190 #endif // __BERRY_WEAK_POINTER_H__