OpenGUI::RefPtr< T > Class Template Reference

#include <OpenGUI_RefPtr.h>

List of all members.


Detailed Description

template<typename T>
class OpenGUI::RefPtr< T >

This is the base template used for any reference counted pointers in OpenGUI.

Warning:
Do not use as a RefPtr in your own applications. At least not in its native form. If you need a RefPtr for your application's use, feel free to steal RefPtr.h from this source tree. Instructions, details, and full source are held within that file.


Public Member Functions

 RefPtr (T *ptr=0)
 Create a RefPtr from an existing pointer, or empty.
 RefPtr (const RefPtr< T > &ptr)
 Create a RefPtr from another RefPtr.
 ~RefPtr ()
 Destructor does the usual unreferencing operation.
unsigned int getRefCount ()
 Return the total number of references to the stored pointer, yourself included.
RefPtr< T > & operator= (const RefPtr< T > &ptr)
 Assignment operator.
T & operator * () const
 The usual *RefPtr resolving.
T * operator-> () const
 The usual RefPtr->somthing resolving.
 operator bool () const
 This makes "if( RefPtr )" work just like "if( !RefPtr.isNull() )".
bool operator== (int p) const
 This allows us to use "if( RefPtr == NULL )" and "if( RefPtr == 0 )".
bool operator!= (int p) const
 used for "if( RefPtr != NULL )" and "if(RefPtr != 0 )"
bool operator== (const T *p) const
 Used for "if( RefPtr == normal_pointer )".
bool operator== (const RefPtr &r) const
 Used for "if( RefPtr == RefPtr )".
bool operator!= (const RefPtr &r) const
 Used for "if( RefPtr != RefPtr )".
bool operator!= (const T *p) const
 Used for "if( RefPtr != normal_pointer )".
bool isNull () const
 RefPtr.isNull() returns true if RefPtr carries no pointer.
T * get () const
 Returns the carried pointer in raw form.


Constructor & Destructor Documentation

template<typename T>
OpenGUI::RefPtr< T >::RefPtr ( T *  ptr = 0  )  [inline]

Create a RefPtr from an existing pointer, or empty.

template<typename T>
OpenGUI::RefPtr< T >::RefPtr ( const RefPtr< T > &  ptr  )  [inline]

Create a RefPtr from another RefPtr.

template<typename T>
OpenGUI::RefPtr< T >::~RefPtr (  )  [inline]

Destructor does the usual unreferencing operation.


Member Function Documentation

template<typename T>
T* OpenGUI::RefPtr< T >::get (  )  const [inline]

Returns the carried pointer in raw form.

template<typename T>
unsigned int OpenGUI::RefPtr< T >::getRefCount (  )  [inline]

Return the total number of references to the stored pointer, yourself included.

template<typename T>
bool OpenGUI::RefPtr< T >::isNull (  )  const [inline]

RefPtr.isNull() returns true if RefPtr carries no pointer.

template<typename T>
T& OpenGUI::RefPtr< T >::operator * (  )  const [inline]

The usual *RefPtr resolving.

template<typename T>
OpenGUI::RefPtr< T >::operator bool (  )  const [inline]

This makes "if( RefPtr )" work just like "if( !RefPtr.isNull() )".

template<typename T>
bool OpenGUI::RefPtr< T >::operator!= ( const T *  p  )  const [inline]

Used for "if( RefPtr != normal_pointer )".

template<typename T>
bool OpenGUI::RefPtr< T >::operator!= ( const RefPtr< T > &  r  )  const [inline]

Used for "if( RefPtr != RefPtr )".

template<typename T>
bool OpenGUI::RefPtr< T >::operator!= ( int  p  )  const [inline]

used for "if( RefPtr != NULL )" and "if(RefPtr != 0 )"

template<typename T>
T* OpenGUI::RefPtr< T >::operator-> (  )  const [inline]

The usual RefPtr->somthing resolving.

template<typename T>
RefPtr<T>& OpenGUI::RefPtr< T >::operator= ( const RefPtr< T > &  ptr  )  [inline]

Assignment operator.

template<typename T>
bool OpenGUI::RefPtr< T >::operator== ( const RefPtr< T > &  r  )  const [inline]

Used for "if( RefPtr == RefPtr )".

template<typename T>
bool OpenGUI::RefPtr< T >::operator== ( const T *  p  )  const [inline]

Used for "if( RefPtr == normal_pointer )".

template<typename T>
bool OpenGUI::RefPtr< T >::operator== ( int  p  )  const [inline]

This allows us to use "if( RefPtr == NULL )" and "if( RefPtr == 0 )".


The documentation for this class was generated from the following file:
Copyright © 2006 OpenGUI | OpenGUI.SF.net
Generated: Fri Jan 5 23:05:25 2007