nux-0.9.46
|
A smart pointer class. Implemented as an intrusive smart pointer. More...
#include <NuxCore/SmartPtr/GenericSmartPointer.h>
Public Member Functions | |
GenericSP () | |
Constructor. | |
GenericSP (const GenericSP< T > &other) | |
Copy constructor. | |
template<typename O > | |
GenericSP (const GenericSP< O > &other) | |
Copy constructor. | |
GenericSP (T *ptr, bool deletewhenrefcounthitzero=true) | |
Construction with a base pointer of type T. | |
template<typename O > | |
GenericSP (O *ptr, bool deletewhenrefcounthitzero=true) | |
Construction with a base pointer of type O that inherits from type T. | |
GenericSP & | operator= (const GenericSP< T > &other) |
Assignment of a smart pointer of type T. | |
template<typename O > | |
GenericSP & | operator= (const GenericSP< O > &other) |
Assignment of a smart pointer of type O that inherits from type T. | |
~GenericSP () | |
T & | operator* () const |
T * | operator-> () const |
void | Swap (GenericSP< T > &other) |
Swap the content of 2 smart pointers. | |
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< (GenericSP< T > other) const |
bool | operator> (GenericSP< 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 GenericSP< U > &other) const |
template<typename U > | |
bool | operator== (const GenericSP< U > &other) const |
template<typename U > | |
bool | operator!= (const GenericWeakSP< U > &other) const |
template<typename U > | |
bool | operator== (const GenericWeakSP< U > &other) const |
void | Release () |
Friends | |
class | GenericSP |
class | GenericWeakSP |
template<typename U > | |
GenericSP< U > | Create () |
template<typename U , typename P1 > | |
GenericSP< U > | Create (P1 p1) |
template<typename U , typename P1 , typename P2 > | |
GenericSP< U > | Create (P1 p1, P2 p2) |
template<typename U , typename P1 , typename P2 , typename P3 > | |
GenericSP< U > | Create (P1 p1, P2 p2, P3 p3) |
template<typename U , typename P1 , typename P2 , typename P3 , typename P4 > | |
GenericSP< U > | Create (P1 p1, P2 p2, P3 p3, P4 p4) |
template<typename U , typename P1 , typename P2 , typename P3 , typename P4 , typename P5 > | |
GenericSP< 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 > | |
GenericSP< 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 > | |
GenericSP< U > | Create (P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7) |
template<typename U > | |
GenericSP< U > | WrapWSPtr (U *u) |
template<typename U > | |
bool | operator== (U *, const GenericSP< U > &a) |
template<typename U > | |
bool | operator!= (U *, const GenericSP< U > &a) |
template<typename U , typename F > | |
GenericSP< U > | staticCast (const GenericSP< F > &from) |
template<typename U , typename F > | |
GenericSP< U > | constCast (const GenericSP< F > &from) |
template<typename U , typename F > | |
GenericSP< U > | dynamicCast (const GenericSP< F > &from) |
template<typename U , typename F > | |
GenericSP< U > | checkedCast (const GenericSP< F > &from) |
template<typename U , typename F > | |
GenericSP< U > | queryCast (const GenericSP< F > &from) |
A smart pointer class. Implemented as an intrusive smart pointer.
nux::GenericSP< T >::GenericSP | ( | ) | [inline] |
Constructor.
nux::GenericSP< T >::GenericSP | ( | const GenericSP< T > & | other | ) | [inline] |
Copy constructor.
References nux::NThreadSafeCounter::Increment(), nux::RefCounts::strongRefs_, and nux::RefCounts::totalRefs_.
nux::GenericSP< T >::GenericSP | ( | const GenericSP< O > & | other | ) | [inline] |
Copy constructor.
other | Parameter with a type derived from T. |
References nux::NThreadSafeCounter::Increment(), nux::RefCounts::strongRefs_, and nux::RefCounts::totalRefs_.
nux::GenericSP< T >::GenericSP | ( | T * | ptr, |
bool | deletewhenrefcounthitzero = true |
||
) | [inline, explicit] |
Construction with a base pointer of type T.
ptr | Start maintaining a reference count of the passed pointer. |
deletewhenrefcounthitzero | if True, the pointer is deleted when the ref count reach 0 (to be deprecated). |
nux::GenericSP< T >::GenericSP | ( | O * | ptr, |
bool | deletewhenrefcounthitzero = true |
||
) | [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. |
deletewhenrefcounthitzero | if True, the pointer is deleted when the ref count reach 0 (to be deprecated). |
References nuxAssert.
nux::GenericSP< T >::~GenericSP | ( | ) | [inline] |
bool nux::GenericSP< T >::IsNull | ( | ) | const [inline] |
Test validity of the smart pointer.
Return True if the internal pointer is null.
bool nux::GenericSP< T >::IsValid | ( | ) | const [inline] |
Test validity of the smart pointer.
Return True if the internal pointer is not null.
bool nux::GenericSP< T >::operator!= | ( | const GenericSP< U > & | other | ) | const [inline] |
bool nux::GenericSP< T >::operator!= | ( | const GenericWeakSP< U > & | other | ) | const [inline] |
bool nux::GenericSP< T >::operator!= | ( | T * | ptr | ) | const [inline] |
bool nux::GenericSP< T >::operator!= | ( | U * | ptr | ) | const [inline] |
bool nux::GenericSP< T >::operator() | ( | ) | const [inline] |
Test validity of the smart pointer.
Return True if the internal pointer is not null.
T& nux::GenericSP< T >::operator* | ( | void | ) | const [inline] |
References nuxAssert.
T* nux::GenericSP< T >::operator-> | ( | ) | const [inline] |
References nuxAssert.
bool nux::GenericSP< T >::operator< | ( | T * | ptr | ) | const [inline] |
bool nux::GenericSP< T >::operator< | ( | GenericSP< T > | other | ) | const [inline] |
GenericSP& nux::GenericSP< T >::operator= | ( | const GenericSP< O > & | other | ) | [inline] |
Assignment of a smart pointer of type O that inherits from type T.
other | Smart pointer of type O. |
References nux::NThreadSafeCounter::Increment(), nux::RefCounts::strongRefs_, and nux::RefCounts::totalRefs_.
GenericSP& nux::GenericSP< T >::operator= | ( | const GenericSP< T > & | other | ) | [inline] |
Assignment of a smart pointer of type T.
other | Smart pointer of type T. |
References nux::NThreadSafeCounter::Increment(), nux::RefCounts::strongRefs_, and nux::RefCounts::totalRefs_.
bool nux::GenericSP< T >::operator== | ( | T * | ptr | ) | const [inline] |
bool nux::GenericSP< T >::operator== | ( | const GenericSP< U > & | other | ) | const [inline] |
bool nux::GenericSP< T >::operator== | ( | const GenericWeakSP< U > & | other | ) | const [inline] |
bool nux::GenericSP< T >::operator== | ( | U * | ptr | ) | const [inline] |
bool nux::GenericSP< T >::operator> | ( | T * | ptr | ) | const [inline] |
bool nux::GenericSP< T >::operator> | ( | GenericSP< T > | other | ) | const [inline] |
void nux::GenericSP< T >::Release | ( | ) | [inline] |
void nux::GenericSP< T >::Swap | ( | GenericSP< T > & | other | ) | [inline] |
Swap the content of 2 smart pointers.
other | Smart pointer to swap with. |
References nux::swap().
GenericSP<U> checkedCast | ( | const GenericSP< F > & | from | ) | [friend] |
GenericSP<U> constCast | ( | const GenericSP< F > & | from | ) | [friend] |
GenericSP<U> Create | ( | P1 | p1, |
P2 | p2, | ||
P3 | p3, | ||
P4 | p4, | ||
P5 | p5 | ||
) | [friend] |
GenericSP<U> Create | ( | P1 | p1, |
P2 | p2, | ||
P3 | p3, | ||
P4 | p4 | ||
) | [friend] |
GenericSP<U> Create | ( | P1 | p1, |
P2 | p2, | ||
P3 | p3, | ||
P4 | p4, | ||
P5 | p5, | ||
P6 | p6 | ||
) | [friend] |
GenericSP<U> Create | ( | P1 | p1, |
P2 | p2 | ||
) | [friend] |
GenericSP<U> Create | ( | P1 | p1, |
P2 | p2, | ||
P3 | p3, | ||
P4 | p4, | ||
P5 | p5, | ||
P6 | p6, | ||
P7 | p7 | ||
) | [friend] |
GenericSP<U> Create | ( | P1 | p1, |
P2 | p2, | ||
P3 | p3 | ||
) | [friend] |
GenericSP<U> dynamicCast | ( | const GenericSP< F > & | from | ) | [friend] |
friend class GenericSP [friend] |
friend class GenericWeakSP [friend] |
bool operator!= | ( | U * | , |
const GenericSP< U > & | a | ||
) | [friend] |
bool operator== | ( | U * | , |
const GenericSP< U > & | a | ||
) | [friend] |
GenericSP<U> queryCast | ( | const GenericSP< F > & | from | ) | [friend] |
GenericSP<U> staticCast | ( | const GenericSP< F > & | from | ) | [friend] |