nux-0.9.48
|
A smart pointer class. Implemented as an intrusive smart pointer. More...
#include <NuxCore/ObjectPtr.h>
Public Member Functions | |
ObjectPtr () | |
Constructor. | |
ObjectPtr (const ObjectPtr< T > &other) | |
Copy constructor. | |
template<typename O > | |
ObjectPtr (const ObjectPtr< O > &other) | |
Copy constructor. | |
ObjectPtr (T *ptr, bool WarnMissuse=false) | |
Construction with a base pointer of type T. | |
template<typename O > | |
ObjectPtr (O *ptr, bool WarnMissuse=false) | |
Construction with a base pointer of type O that inherits from type T. | |
ObjectPtr & | operator= (const ObjectPtr< T > &other) |
Assignment of a smart pointer of type T. | |
template<typename O > | |
ObjectPtr & | operator= (const ObjectPtr< O > &other) |
Assignment of a smart pointer of type O that inherits from type T. | |
T * | GetSPPointer () const |
~ObjectPtr () | |
T & | operator* () const |
T * | operator-> () const |
bool | operator() () const |
Test validity of the smart pointer. | |
bool | IsNull () const |
Test validity of the smart pointer. | |
bool | IsValid () const |
Test validity of the smart pointer. | |
bool | operator< (T *ptr) const |
bool | operator> (T *ptr) const |
bool | operator< (ObjectPtr< T > other) const |
bool | operator> (ObjectPtr< T > other) const |
bool | operator!= (T *ptr) const |
bool | operator== (T *ptr) const |
template<typename U > | |
bool | operator!= (U *ptr) const |
template<typename U > | |
bool | operator== (U *ptr) const |
template<typename U > | |
bool | operator!= (const ObjectPtr< U > &other) const |
template<typename U > | |
bool | operator== (const ObjectPtr< U > &other) const |
template<typename U > | |
bool | operator!= (const ObjectWeakPtr< U > &other) const |
template<typename U > | |
bool | operator== (const ObjectWeakPtr< U > &other) const |
bool | Release () |
Release the hosted pointer from this object. | |
Friends | |
class | ObjectPtr |
class | ObjectWeakPtr |
template<typename U > | |
ObjectPtr< U > | Create () |
template<typename U , typename P1 > | |
ObjectPtr< U > | Create (P1 p1) |
template<typename U , typename P1 , typename P2 > | |
ObjectPtr< U > | Create (P1 p1, P2 p2) |
template<typename U , typename P1 , typename P2 , typename P3 > | |
ObjectPtr< U > | Create (P1 p1, P2 p2, P3 p3) |
template<typename U , typename P1 , typename P2 , typename P3 , typename P4 > | |
ObjectPtr< U > | Create (P1 p1, P2 p2, P3 p3, P4 p4) |
template<typename U , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 > | |
ObjectPtr< U > | Create (P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) |
template<typename U , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 > | |
ObjectPtr< U > | Create (P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) |
template<typename U , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 , typename P6 , typename P7 > | |
ObjectPtr< U > | Create (P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7) |
template<typename U > | |
ObjectPtr< U > | WrapWSPtr (U *u) |
template<typename U > | |
bool | operator== (U *, const ObjectPtr< U > &a) |
template<typename U > | |
bool | operator!= (U *, const ObjectPtr< U > &a) |
template<typename U , typename F > | |
ObjectPtr< U > | staticCast (const ObjectPtr< F > &from) |
template<typename U , typename F > | |
ObjectPtr< U > | constCast (const ObjectPtr< F > &from) |
template<typename U , typename F > | |
ObjectPtr< U > | dynamicCast (const ObjectPtr< F > &from) |
template<typename U , typename F > | |
ObjectPtr< U > | checkedCast (const ObjectPtr< F > &from) |
template<typename U , typename F > | |
ObjectPtr< U > | queryCast (const ObjectPtr< F > &from) |
A smart pointer class. Implemented as an intrusive smart pointer.
nux::ObjectPtr< T >::ObjectPtr | ( | ) | [inline] |
Constructor.
nux::ObjectPtr< T >::ObjectPtr | ( | const ObjectPtr< T > & | other | ) | [inline] |
Copy constructor.
nux::ObjectPtr< T >::ObjectPtr | ( | const ObjectPtr< O > & | other | ) | [inline] |
Copy constructor.
other | Parameter with a type derived from T. |
nux::ObjectPtr< T >::ObjectPtr | ( | T * | ptr, |
bool | WarnMissuse = false |
||
) | [inline, explicit] |
Construction with a base pointer of type T.
ptr | Start maintaining a reference count of the passed pointer. |
WarnMissuse | If True, then ObjectPtr test is ptr is owned or not. If ptr is not owned and WarnMissuse is True, then Print a warning message. This is a debug feature to detect cases such as "ObjectPtr(ObjectA) myobject(ptr);", because the calling code will no longer have a reference on ptr. |
nux::ObjectPtr< T >::ObjectPtr | ( | O * | ptr, |
bool | WarnMissuse = false |
||
) | [inline, explicit] |
Construction with a base pointer of type O that inherits from type T.
ptr | Start maintaining a reference count of the passed pointer. |
WarnMissuse | If True, then ObjectPtr test is ptr is owned or not. If ptr is not owned and WarnMissuse is True, then Print a warning message. This is a debug feature to detect cases such as "ObjectPtr(ObjectA) myobject(ptr);", because the calling code will no longer have a reference on ptr. |
nux::ObjectPtr< T >::~ObjectPtr | ( | ) | [inline] |
T* nux::ObjectPtr< T >::GetSPPointer | ( | ) | const [inline] |
bool nux::ObjectPtr< T >::IsNull | ( | ) | const [inline] |
Test validity of the smart pointer.
Return True if the internal pointer is null.
bool nux::ObjectPtr< T >::IsValid | ( | ) | const [inline] |
Test validity of the smart pointer.
Return True if the internal pointer is not null.
Referenced by nux::TResourceCache< int, CachedResourceData >::FlushResourceId().
bool nux::ObjectPtr< T >::operator!= | ( | const ObjectPtr< U > & | other | ) | const [inline] |
bool nux::ObjectPtr< T >::operator!= | ( | const ObjectWeakPtr< U > & | other | ) | const [inline] |
bool nux::ObjectPtr< T >::operator!= | ( | T * | ptr | ) | const [inline] |
bool nux::ObjectPtr< T >::operator!= | ( | U * | ptr | ) | const [inline] |
bool nux::ObjectPtr< T >::operator() | ( | ) | const [inline] |
Test validity of the smart pointer.
other | Smart pointer to swap with. |
Return True if the internal pointer is not null.
T& nux::ObjectPtr< T >::operator* | ( | void | ) | const [inline] |
T* nux::ObjectPtr< T >::operator-> | ( | ) | const [inline] |
bool nux::ObjectPtr< T >::operator< | ( | T * | ptr | ) | const [inline] |
bool nux::ObjectPtr< T >::operator< | ( | ObjectPtr< T > | other | ) | const [inline] |
ObjectPtr& nux::ObjectPtr< T >::operator= | ( | const ObjectPtr< O > & | other | ) | [inline] |
Assignment of a smart pointer of type O that inherits from type T.
other | Smart pointer of type O. |
ObjectPtr& nux::ObjectPtr< T >::operator= | ( | const ObjectPtr< T > & | other | ) | [inline] |
Assignment of a smart pointer of type T.
other | Smart pointer of type T. |
bool nux::ObjectPtr< T >::operator== | ( | T * | ptr | ) | const [inline] |
bool nux::ObjectPtr< T >::operator== | ( | const ObjectPtr< U > & | other | ) | const [inline] |
bool nux::ObjectPtr< T >::operator== | ( | const ObjectWeakPtr< U > & | other | ) | const [inline] |
bool nux::ObjectPtr< T >::operator== | ( | U * | ptr | ) | const [inline] |
bool nux::ObjectPtr< T >::operator> | ( | T * | ptr | ) | const [inline] |
bool nux::ObjectPtr< T >::operator> | ( | ObjectPtr< T > | other | ) | const [inline] |
bool nux::ObjectPtr< T >::Release | ( | ) | [inline] |
Release the hosted pointer from this object.
Release the hosted pointer from this object. After this call, the following members are null: _reference_count _weak_reference_count ptr_ This call decreases the count of strong and weak references reference before setting _reference_count and _weak_reference_count to null.
ObjectPtr<U> checkedCast | ( | const ObjectPtr< F > & | from | ) | [friend] |
ObjectPtr<U> constCast | ( | const ObjectPtr< F > & | from | ) | [friend] |
ObjectPtr<U> Create | ( | P1 | p1, |
P2 | p2, | ||
P3 | p3, | ||
P4 | p4, | ||
P5 | p5 | ||
) | [friend] |
ObjectPtr<U> Create | ( | P1 | p1, |
P2 | p2, | ||
P3 | p3, | ||
P4 | p4 | ||
) | [friend] |
ObjectPtr<U> Create | ( | P1 | p1, |
P2 | p2, | ||
P3 | p3, | ||
P4 | p4, | ||
P5 | p5, | ||
P6 | p6 | ||
) | [friend] |
ObjectPtr<U> Create | ( | P1 | p1, |
P2 | p2 | ||
) | [friend] |
ObjectPtr<U> Create | ( | P1 | p1, |
P2 | p2, | ||
P3 | p3, | ||
P4 | p4, | ||
P5 | p5, | ||
P6 | p6, | ||
P7 | p7 | ||
) | [friend] |
ObjectPtr<U> Create | ( | P1 | p1, |
P2 | p2, | ||
P3 | p3 | ||
) | [friend] |
ObjectPtr<U> dynamicCast | ( | const ObjectPtr< F > & | from | ) | [friend] |
friend class ObjectPtr [friend] |
friend class ObjectWeakPtr [friend] |
bool operator!= | ( | U * | , |
const ObjectPtr< U > & | a | ||
) | [friend] |
bool operator== | ( | U * | , |
const ObjectPtr< U > & | a | ||
) | [friend] |
ObjectPtr<U> queryCast | ( | const ObjectPtr< F > & | from | ) | [friend] |
ObjectPtr<U> staticCast | ( | const ObjectPtr< F > & | from | ) | [friend] |