nux-0.9.48
|
A weak smart pointer class. Implemented as an intrusive smart pointer. More...
#include <NuxCore/SmartPtr/GenericSmartPointer.h>
Public Member Functions | |
GenericWeakSP () | |
Constructor. | |
GenericWeakSP (const GenericWeakSP< T > &other) | |
Copy constructor. | |
template<typename O > | |
GenericWeakSP (const GenericWeakSP< O > &other) | |
Copy constructor. | |
template<typename O > | |
GenericWeakSP (const GenericSP< O > &other) | |
Construction from a smart pointer of type O that inherits from type T. | |
GenericWeakSP & | operator= (const GenericWeakSP< T > &other) |
Assignment of a weak smart pointer of type T. | |
template<typename O > | |
GenericWeakSP & | operator= (const GenericWeakSP< O > &other) |
Assignment of a weak smart pointer of Type O that inherits from type T. | |
template<typename O > | |
GenericWeakSP & | operator= (const GenericSP< O > &other) |
Assignment of a smart pointer of Type O that inherits from type T. | |
~GenericWeakSP () | |
T & | operator* () const |
T * | operator-> () const |
void | Swap (GenericWeakSP< T > &other) |
bool | operator< (T *ptr) const |
bool | operator> (T *ptr) const |
bool | operator< (GenericWeakSP< T > other) const |
bool | operator> (GenericWeakSP< 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 GenericWeakSP< U > &other) const |
template<typename U > | |
bool | operator== (const GenericWeakSP< U > &other) const |
template<typename U > | |
bool | operator!= (const GenericSP< U > &other) const |
template<typename U > | |
bool | operator== (const GenericSP< U > &other) const |
bool | IsNull () const |
bool | IsValid () const |
void | Release () |
Friends | |
class | GenericWeakSP |
class | SmartPtr |
template<typename U > | |
bool | operator== (U *, const GenericWeakSP< U > &a) |
template<typename U > | |
bool | operator!= (U *, const GenericWeakSP< U > &a) |
template<typename U , typename F > | |
GenericWeakSP< U > | staticCast (const GenericWeakSP< F > &from) |
template<typename U , typename F > | |
GenericWeakSP< U > | constCast (const GenericWeakSP< F > &from) |
template<typename U , typename F > | |
GenericWeakSP< U > | dynamicCast (const GenericWeakSP< F > &from) |
template<typename U , typename F > | |
GenericWeakSP< U > | checkedCast (const GenericWeakSP< F > &from) |
template<typename U , typename F > | |
GenericWeakSP< U > | queryCast (const GenericWeakSP< F > &from) |
A weak smart pointer class. Implemented as an intrusive smart pointer.
A weak smart pointer is built from a smart pointer or another weak smart pointer. It increments and decrements the total reference count of an pointer. Even is the original pointer is destroyed, weak smart pointers still point to the RefCounts pointers of the original pointer and can use it to check if the pointer is still valid or not.
nux::GenericWeakSP< T >::GenericWeakSP | ( | ) | [inline] |
Constructor.
nux::GenericWeakSP< T >::GenericWeakSP | ( | const GenericWeakSP< T > & | other | ) | [inline] |
Copy constructor.
other | Parameter with type T. |
References nux::NThreadSafeCounter::Increment(), and nux::RefCounts::totalRefs_.
nux::GenericWeakSP< T >::GenericWeakSP | ( | const GenericWeakSP< O > & | other | ) | [inline] |
Copy constructor.
other | Parameter with a type derived from T. |
References nux::NThreadSafeCounter::Increment(), and nux::RefCounts::totalRefs_.
nux::GenericWeakSP< T >::GenericWeakSP | ( | const GenericSP< O > & | other | ) | [inline] |
Construction from a smart pointer of type O that inherits from type T.
other | Maintains a weak smart pointer reference to this parameter. |
other | Maintains a weak smart pointer reference to this parameter. |
References nux::NThreadSafeCounter::Increment(), and nux::RefCounts::totalRefs_.
nux::GenericWeakSP< T >::~GenericWeakSP | ( | ) | [inline] |
bool nux::GenericWeakSP< T >::IsNull | ( | ) | const [inline] |
bool nux::GenericWeakSP< T >::IsValid | ( | ) | const [inline] |
bool nux::GenericWeakSP< T >::operator!= | ( | const GenericSP< U > & | other | ) | const [inline] |
bool nux::GenericWeakSP< T >::operator!= | ( | T * | ptr | ) | const [inline] |
bool nux::GenericWeakSP< T >::operator!= | ( | U * | ptr | ) | const [inline] |
bool nux::GenericWeakSP< T >::operator!= | ( | const GenericWeakSP< U > & | other | ) | const [inline] |
T& nux::GenericWeakSP< T >::operator* | ( | void | ) | const [inline] |
References nux::NThreadSafeCounter::GetValue(), nuxAssert, and nux::RefCounts::strongRefs_.
T* nux::GenericWeakSP< T >::operator-> | ( | ) | const [inline] |
References nux::NThreadSafeCounter::GetValue(), nuxAssert, and nux::RefCounts::strongRefs_.
bool nux::GenericWeakSP< T >::operator< | ( | GenericWeakSP< T > | other | ) | const [inline] |
bool nux::GenericWeakSP< T >::operator< | ( | T * | ptr | ) | const [inline] |
GenericWeakSP& nux::GenericWeakSP< T >::operator= | ( | const GenericWeakSP< O > & | other | ) | [inline] |
Assignment of a weak smart pointer of Type O that inherits from type T.
other | Weak smart pointer of type O. |
References nux::NThreadSafeCounter::Increment(), and nux::RefCounts::totalRefs_.
GenericWeakSP& nux::GenericWeakSP< T >::operator= | ( | const GenericWeakSP< T > & | other | ) | [inline] |
Assignment of a weak smart pointer of type T.
other | Weak smart pointer of type T. |
References nux::NThreadSafeCounter::Increment(), and nux::RefCounts::totalRefs_.
GenericWeakSP& nux::GenericWeakSP< T >::operator= | ( | const GenericSP< O > & | other | ) | [inline] |
Assignment of a smart pointer of Type O that inherits from type T.
other | Maintains a weak smart pointer reference to this parameter. |
References nux::NThreadSafeCounter::Increment(), and nux::RefCounts::totalRefs_.
bool nux::GenericWeakSP< T >::operator== | ( | const GenericSP< U > & | other | ) | const [inline] |
bool nux::GenericWeakSP< T >::operator== | ( | U * | ptr | ) | const [inline] |
bool nux::GenericWeakSP< T >::operator== | ( | const GenericWeakSP< U > & | other | ) | const [inline] |
bool nux::GenericWeakSP< T >::operator== | ( | T * | ptr | ) | const [inline] |
bool nux::GenericWeakSP< T >::operator> | ( | GenericWeakSP< T > | other | ) | const [inline] |
bool nux::GenericWeakSP< T >::operator> | ( | T * | ptr | ) | const [inline] |
void nux::GenericWeakSP< T >::Release | ( | ) | [inline] |
void nux::GenericWeakSP< T >::Swap | ( | GenericWeakSP< T > & | other | ) | [inline] |
References nux::swap().
GenericWeakSP<U> checkedCast | ( | const GenericWeakSP< F > & | from | ) | [friend] |
GenericWeakSP<U> constCast | ( | const GenericWeakSP< F > & | from | ) | [friend] |
GenericWeakSP<U> dynamicCast | ( | const GenericWeakSP< F > & | from | ) | [friend] |
friend class GenericWeakSP [friend] |
bool operator!= | ( | U * | , |
const GenericWeakSP< U > & | a | ||
) | [friend] |
bool operator== | ( | U * | , |
const GenericWeakSP< U > & | a | ||
) | [friend] |
GenericWeakSP<U> queryCast | ( | const GenericWeakSP< F > & | from | ) | [friend] |
friend class SmartPtr [friend] |
GenericWeakSP<U> staticCast | ( | const GenericWeakSP< F > & | from | ) | [friend] |