Public Member Functions | Friends

CL_WeakPtr< Type > Class Template Reference
[clanCore System]

Weak pointer class (pointer to a CL_SharedPtr object that dont increase reference count). More...

#include <weakptr.h>

List of all members.

Public Member Functions

 CL_WeakPtr ()
 CL_WeakPtr (const CL_WeakPtr< Type > &copy)
 CL_WeakPtr (const CL_SharedPtr< Type > &copy)
 ~CL_WeakPtr ()
bool disconnect ()
Type * get ()
 Retrieves the pointer.
const Type * get () const
 Retrieves the pointer.
bool is_invalid_weak_link () const
bool is_null () const
 Tests if the pointer is unset, or the weak link is no longer valid.
template<typename InitType >
 operator CL_SharedPtr< InitType > ()
template<typename InitType >
 operator CL_SharedPtr< InitType > () const
 operator CL_SharedPtr< Type > ()
 operator CL_SharedPtr< Type > () const
 operator const Type * () const
 operator Type * ()
template<typename OtherType >
bool operator!= (OtherType *other) const
Type * operator-> ()
const Type * operator-> () const
template<typename OtherType >
bool operator< (OtherType *other) const
template<typename OtherType >
bool operator<= (OtherType *other) const
CL_WeakPtroperator= (const CL_SharedPtr< Type > &copy)
CL_WeakPtroperator= (const CL_WeakPtr &copy)
template<typename OtherType >
bool operator== (OtherType *other) const
template<typename OtherType >
bool operator> (OtherType *other) const
template<typename OtherType >
bool operator>= (OtherType *other) const
CL_SharedPtr< Type > to_sharedptr () const

Friends

class CL_SharedPtr< Type >

Detailed Description

template<typename Type>
class CL_WeakPtr< Type >

Weak pointer class (pointer to a CL_SharedPtr object that dont increase reference count).

Use CL_WeakPtr when you want to have a pointer that is reference counted by CL_SharedPtr but want a pointer that don't increase the reference count.

The purpose of CL_WeakPtr is to avoid circular loop issues. By using CL_WeakPtr you can construct new CL_SharedPtr'ed objects based on the weak pointer.


Constructor & Destructor Documentation

template<typename Type>
CL_WeakPtr< Type >::CL_WeakPtr (  )  [inline]
template<typename Type>
CL_WeakPtr< Type >::CL_WeakPtr ( const CL_WeakPtr< Type > &  copy  )  [inline]
template<typename Type>
CL_WeakPtr< Type >::CL_WeakPtr ( const CL_SharedPtr< Type > &  copy  )  [inline, explicit]
template<typename Type>
CL_WeakPtr< Type >::~CL_WeakPtr (  )  [inline]

Member Function Documentation

template<typename Type>
bool CL_WeakPtr< Type >::disconnect (  )  [inline]
template<typename Type>
Type* CL_WeakPtr< Type >::get (  )  [inline]

Retrieves the pointer.

Returns:
The pointer (May be NULL, if it has not been set or the weak link is no longer valid)
template<typename Type>
const Type* CL_WeakPtr< Type >::get (  )  const [inline]

Retrieves the pointer.

Returns:
The pointer (May be NULL, if it has not been set or the weak link is no longer valid)
template<typename Type>
bool CL_WeakPtr< Type >::is_invalid_weak_link (  )  const [inline]
template<typename Type>
bool CL_WeakPtr< Type >::is_null (  )  const [inline]

Tests if the pointer is unset, or the weak link is no longer valid.

Returns:
true, pointer not set (or not valid)
template<typename Type>
template<typename InitType >
CL_WeakPtr< Type >::operator CL_SharedPtr< InitType > (  )  [inline]
template<typename Type>
template<typename InitType >
CL_WeakPtr< Type >::operator CL_SharedPtr< InitType > (  )  const [inline]
template<typename Type>
CL_WeakPtr< Type >::operator CL_SharedPtr< Type > (  )  [inline]
template<typename Type>
CL_WeakPtr< Type >::operator CL_SharedPtr< Type > (  )  const [inline]
template<typename Type>
CL_WeakPtr< Type >::operator const Type * (  )  const [inline]
template<typename Type>
CL_WeakPtr< Type >::operator Type * (  )  [inline]
template<typename Type>
template<typename OtherType >
bool CL_WeakPtr< Type >::operator!= ( OtherType *  other  )  const [inline]
template<typename Type>
Type* CL_WeakPtr< Type >::operator-> (  )  [inline]
template<typename Type>
const Type* CL_WeakPtr< Type >::operator-> (  )  const [inline]
template<typename Type>
template<typename OtherType >
bool CL_WeakPtr< Type >::operator< ( OtherType *  other  )  const [inline]
template<typename Type>
template<typename OtherType >
bool CL_WeakPtr< Type >::operator<= ( OtherType *  other  )  const [inline]
template<typename Type>
CL_WeakPtr& CL_WeakPtr< Type >::operator= ( const CL_WeakPtr< Type > &  copy  )  [inline]
template<typename Type>
CL_WeakPtr& CL_WeakPtr< Type >::operator= ( const CL_SharedPtr< Type > &  copy  )  [inline]
template<typename Type>
template<typename OtherType >
bool CL_WeakPtr< Type >::operator== ( OtherType *  other  )  const [inline]
template<typename Type>
template<typename OtherType >
bool CL_WeakPtr< Type >::operator> ( OtherType *  other  )  const [inline]
template<typename Type>
template<typename OtherType >
bool CL_WeakPtr< Type >::operator>= ( OtherType *  other  )  const [inline]
template<typename Type>
CL_SharedPtr<Type> CL_WeakPtr< Type >::to_sharedptr (  )  const [inline]

Friends And Related Function Documentation

template<typename Type>
friend class CL_SharedPtr< Type > [friend]

Member Data Documentation

template<typename Type>
CL_SharedPtrData* CL_WeakPtr< Type >::data
template<typename Type>
Type** CL_WeakPtr< Type >::p

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