89 T*
Get()
const {
return _ptr; }
91 T*&
Get() {
return _ptr; }
113 operator T*()
const {
return _ptr; }
115 template <
typename D>
122 return (_ptr->QueryInterface(D::GetClassId()) !=
nullptr);
149 template <
typename T>
bool operator==(
const ObjectPtr<T>& ptr,
const T* p) {
return ptr.Get() == p; }
150 template <
typename T>
bool operator==(
const ObjectPtr<T>& ptr, T* p) {
return ptr.Get() == p; }
T * Get() const
Definition: ObjectPtr.h:89
ObjectPtr(const ObjectPtr< T > &ptr)
Definition: ObjectPtr.h:20
~ObjectPtr()
Definition: ObjectPtr.h:35
T * Detach()
Definition: ObjectPtr.h:106
ObjectPtr< D > DynamicCastAttach(IObject *p)
Safe cast an IObject to a pointer of a different type. Does not call AddRef() on the interface.
Definition: ObjectPtr.h:177
ObjectPtr< D > IsA(IObject *p)
Definition: ObjectPtr.h:184
ObjectPtr(T *ptr)
Definition: ObjectPtr.h:26
ObjectPtr< T > & operator=(const ObjectPtr< T > &ptr)
Definition: ObjectPtr.h:72
T *& Get()
Definition: ObjectPtr.h:91
void Attach(IObject *ptr)
Definition: ObjectPtr.h:93
T * operator->() const
Definition: ObjectPtr.h:87
Smart pointer to an IObject. Automatic ref counting.
Definition: ObjectPtr.h:16
Definition: A2CTrainer.h:10
Base class for SmartEngine AI objects. It is not common to deal with this class directly.
Definition: Object.h:19
void Clear()
Definition: ObjectPtr.h:37
virtual void * QueryInterface(ObjectClassId id)=0
Queries the object for an interface and returns a pointer to that interface if found.
bool IsA()
Definition: ObjectPtr.h:116
ObjectPtr< T > & operator=(IObject *ptr)
Definition: ObjectPtr.h:47
ObjectPtr()
Definition: ObjectPtr.h:18
ObjectPtr< T > & operator=(ObjectPtr< T > &&ptr)
Definition: ObjectPtr.h:39
ObjectPtr< D > DynamicCast(IObject *p)
Safe cast an IObject to a pointer of a different type.
Definition: ObjectPtr.h:156