nux-0.9.48

nux::GenericWeakSP< T > Class Template Reference

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.
GenericWeakSPoperator= (const GenericWeakSP< T > &other)
 Assignment of a weak smart pointer of type T.
template<typename O >
GenericWeakSPoperator= (const GenericWeakSP< O > &other)
 Assignment of a weak smart pointer of Type O that inherits from type T.
template<typename O >
GenericWeakSPoperator= (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)

Detailed Description

template<typename T>
class nux::GenericWeakSP< T >

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.


Constructor & Destructor Documentation

template<typename T>
nux::GenericWeakSP< T >::GenericWeakSP ( ) [inline]

Constructor.

template<typename T>
nux::GenericWeakSP< T >::GenericWeakSP ( const GenericWeakSP< T > &  other) [inline]

Copy constructor.

Parameters:
otherParameter with type T.

References nux::NThreadSafeCounter::Increment(), and nux::RefCounts::totalRefs_.

template<typename T>
template<typename O >
nux::GenericWeakSP< T >::GenericWeakSP ( const GenericWeakSP< O > &  other) [inline]

Copy constructor.

Parameters:
otherParameter with a type derived from T.

References nux::NThreadSafeCounter::Increment(), and nux::RefCounts::totalRefs_.

template<typename T>
template<typename O >
nux::GenericWeakSP< T >::GenericWeakSP ( const GenericSP< O > &  other) [inline]

Construction from a smart pointer of type O that inherits from type T.

Parameters:
otherMaintains a weak smart pointer reference to this parameter.
otherMaintains a weak smart pointer reference to this parameter.

References nux::NThreadSafeCounter::Increment(), and nux::RefCounts::totalRefs_.

template<typename T>
nux::GenericWeakSP< T >::~GenericWeakSP ( ) [inline]

Member Function Documentation

template<typename T>
bool nux::GenericWeakSP< T >::IsNull ( ) const [inline]
template<typename T>
bool nux::GenericWeakSP< T >::IsValid ( ) const [inline]
template<typename T>
template<typename U >
bool nux::GenericWeakSP< T >::operator!= ( const GenericSP< U > &  other) const [inline]
template<typename T>
bool nux::GenericWeakSP< T >::operator!= ( T *  ptr) const [inline]
template<typename T>
template<typename U >
bool nux::GenericWeakSP< T >::operator!= ( U *  ptr) const [inline]
template<typename T>
template<typename U >
bool nux::GenericWeakSP< T >::operator!= ( const GenericWeakSP< U > &  other) const [inline]
template<typename T>
T& nux::GenericWeakSP< T >::operator* ( void  ) const [inline]
template<typename T>
T* nux::GenericWeakSP< T >::operator-> ( ) const [inline]
template<typename T>
bool nux::GenericWeakSP< T >::operator< ( GenericWeakSP< T >  other) const [inline]
template<typename T>
bool nux::GenericWeakSP< T >::operator< ( T *  ptr) const [inline]
template<typename T>
template<typename O >
GenericWeakSP& nux::GenericWeakSP< T >::operator= ( const GenericWeakSP< O > &  other) [inline]

Assignment of a weak smart pointer of Type O that inherits from type T.

Parameters:
otherWeak smart pointer of type O.

References nux::NThreadSafeCounter::Increment(), and nux::RefCounts::totalRefs_.

template<typename T>
GenericWeakSP& nux::GenericWeakSP< T >::operator= ( const GenericWeakSP< T > &  other) [inline]

Assignment of a weak smart pointer of type T.

Parameters:
otherWeak smart pointer of type T.

References nux::NThreadSafeCounter::Increment(), and nux::RefCounts::totalRefs_.

template<typename T>
template<typename O >
GenericWeakSP& nux::GenericWeakSP< T >::operator= ( const GenericSP< O > &  other) [inline]

Assignment of a smart pointer of Type O that inherits from type T.

Parameters:
otherMaintains a weak smart pointer reference to this parameter.

References nux::NThreadSafeCounter::Increment(), and nux::RefCounts::totalRefs_.

template<typename T>
template<typename U >
bool nux::GenericWeakSP< T >::operator== ( const GenericSP< U > &  other) const [inline]
template<typename T>
template<typename U >
bool nux::GenericWeakSP< T >::operator== ( U *  ptr) const [inline]
template<typename T>
template<typename U >
bool nux::GenericWeakSP< T >::operator== ( const GenericWeakSP< U > &  other) const [inline]
template<typename T>
bool nux::GenericWeakSP< T >::operator== ( T *  ptr) const [inline]
template<typename T>
bool nux::GenericWeakSP< T >::operator> ( GenericWeakSP< T >  other) const [inline]
template<typename T>
bool nux::GenericWeakSP< T >::operator> ( T *  ptr) const [inline]
template<typename T>
void nux::GenericWeakSP< T >::Release ( ) [inline]
template<typename T>
void nux::GenericWeakSP< T >::Swap ( GenericWeakSP< T > &  other) [inline]

References nux::swap().


Friends And Related Function Documentation

template<typename T>
template<typename U , typename F >
GenericWeakSP<U> checkedCast ( const GenericWeakSP< F > &  from) [friend]
template<typename T>
template<typename U , typename F >
GenericWeakSP<U> constCast ( const GenericWeakSP< F > &  from) [friend]
template<typename T>
template<typename U , typename F >
GenericWeakSP<U> dynamicCast ( const GenericWeakSP< F > &  from) [friend]
template<typename T>
friend class GenericWeakSP [friend]
template<typename T>
template<typename U >
bool operator!= ( U *  ,
const GenericWeakSP< U > &  a 
) [friend]
template<typename T>
template<typename U >
bool operator== ( U *  ,
const GenericWeakSP< U > &  a 
) [friend]
template<typename T>
template<typename U , typename F >
GenericWeakSP<U> queryCast ( const GenericWeakSP< F > &  from) [friend]
template<typename T>
friend class SmartPtr [friend]
template<typename T>
template<typename U , typename F >
GenericWeakSP<U> staticCast ( const GenericWeakSP< F > &  from) [friend]

The documentation for this class was generated from the following file: