Lunchbox  1.4.0
Public Member Functions
lunchbox::RefPtr< T > Class Template Reference

A smart reference pointer, aka boost::intrusive_ptr. More...

#include <refPtr.h>

List of all members.

Public Member Functions

 RefPtr ()
 Construct a new, empty reference pointer.
 RefPtr (T *const ptr)
 Construct a reference pointer from a C pointer.
 RefPtr (const RefPtr &from)
 Construct a copy of a reference pointer.
template<class O >
 RefPtr (RefPtr< O > from)
 Construct a copy of a reference pointer of a different type.
 ~RefPtr ()
 Destruct this reference pointer.
RefPtroperator= (const RefPtr &rhs)
 Assign another RefPtr to this reference pointer.
RefPtroperator= (T *ptr)
 Assign a C pointer to this reference pointer.
bool operator== (const RefPtr &rhs) const
bool operator!= (const RefPtr &rhs) const
 operator bool_t () const
bool operator< (const RefPtr &rhs) const
bool operator> (const RefPtr &rhs) const
bool operator! () const
bool operator== (const T *ptr) const
bool operator!= (const T *ptr) const
T * operator-> ()
 Access the held object.
const T * operator-> () const
 Access the held object.
T & operator* ()
 Access the held object.
const T & operator* () const
 Access the held object.
T * get ()
const T * get () const
bool isValid () const

Detailed Description

template<class T>
class lunchbox::RefPtr< T >

A smart reference pointer, aka boost::intrusive_ptr.

Relies on the held object to implement ref() and unref() correctly.

Definition at line 33 of file refPtr.h.


Constructor & Destructor Documentation

template<class T>
lunchbox::RefPtr< T >::RefPtr ( ) [inline]

Construct a new, empty reference pointer.

Version:
1.0

Definition at line 39 of file refPtr.h.

template<class T>
lunchbox::RefPtr< T >::RefPtr ( T *const  ptr) [inline]

Construct a reference pointer from a C pointer.

Version:
1.0

Definition at line 42 of file refPtr.h.

template<class T>
lunchbox::RefPtr< T >::RefPtr ( const RefPtr< T > &  from) [inline]

Construct a copy of a reference pointer.

Version:
1.0

Definition at line 45 of file refPtr.h.

template<class T>
template<class O >
lunchbox::RefPtr< T >::RefPtr ( RefPtr< O >  from) [inline]

Construct a copy of a reference pointer of a different type.

Version:
1.0

Definition at line 51 of file refPtr.h.

template<class T>
lunchbox::RefPtr< T >::~RefPtr ( ) [inline]

Destruct this reference pointer.

Version:
1.0

Definition at line 55 of file refPtr.h.


Member Function Documentation

template<class T>
T* lunchbox::RefPtr< T >::get ( ) [inline]
Returns:
the C pointer.
Version:
1.0

Definition at line 146 of file refPtr.h.

template<class T>
const T* lunchbox::RefPtr< T >::get ( ) const [inline]
Returns:
the C pointer.
Version:
1.0

Definition at line 148 of file refPtr.h.

template<class T>
bool lunchbox::RefPtr< T >::isValid ( ) const [inline]
Returns:
true if the RefPtr holds a non-0 pointer.
Version:
1.0

Definition at line 151 of file refPtr.h.

template<class T>
lunchbox::RefPtr< T >::operator bool_t ( ) const [inline]
Returns:
true if a pointer is held, false otherwise.
Version:
1.1.5

Definition at line 101 of file refPtr.h.

template<class T>
bool lunchbox::RefPtr< T >::operator! ( ) const [inline]
Returns:
true if the RefPtr is empty.
Version:
1.0

Definition at line 118 of file refPtr.h.

template<class T>
bool lunchbox::RefPtr< T >::operator!= ( const RefPtr< T > &  rhs) const [inline]
Returns:
true if both reference pointer hold different C pointer.
Version:
1.0

Definition at line 94 of file refPtr.h.

template<class T>
bool lunchbox::RefPtr< T >::operator!= ( const T *  ptr) const [inline]
Returns:
true if the reference pointers does not hold the C pointer
Version:
1.0

Definition at line 130 of file refPtr.h.

template<class T>
T& lunchbox::RefPtr< T >::operator* ( ) [inline]

Access the held object.

Version:
1.0

Definition at line 139 of file refPtr.h.

References lunchbox::className().

+ Here is the call graph for this function:

template<class T>
const T& lunchbox::RefPtr< T >::operator* ( ) const [inline]

Access the held object.

Version:
1.0

Definition at line 142 of file refPtr.h.

References lunchbox::className().

+ Here is the call graph for this function:

template<class T>
T* lunchbox::RefPtr< T >::operator-> ( ) [inline]

Access the held object.

Version:
1.0

Definition at line 133 of file refPtr.h.

References lunchbox::className().

+ Here is the call graph for this function:

template<class T>
const T* lunchbox::RefPtr< T >::operator-> ( ) const [inline]

Access the held object.

Version:
1.0

Definition at line 136 of file refPtr.h.

References lunchbox::className().

+ Here is the call graph for this function:

template<class T>
bool lunchbox::RefPtr< T >::operator< ( const RefPtr< T > &  rhs) const [inline]
Returns:
true if the left RefPtr is smaller then the right.
Version:
1.0

Definition at line 107 of file refPtr.h.

template<class T>
RefPtr& lunchbox::RefPtr< T >::operator= ( const RefPtr< T > &  rhs) [inline]

Assign another RefPtr to this reference pointer.

Version:
1.0

Definition at line 58 of file refPtr.h.

template<class T>
RefPtr& lunchbox::RefPtr< T >::operator= ( T *  ptr) [inline]

Assign a C pointer to this reference pointer.

Version:
1.0

Definition at line 71 of file refPtr.h.

template<class T>
bool lunchbox::RefPtr< T >::operator== ( const RefPtr< T > &  rhs) const [inline]
Returns:
true if both reference pointers hold the same C pointer.
Version:
1.0

Definition at line 87 of file refPtr.h.

template<class T>
bool lunchbox::RefPtr< T >::operator== ( const T *  ptr) const [inline]
Returns:
true if the reference pointers holds the C pointer.
Version:
1.0

Definition at line 124 of file refPtr.h.

template<class T>
bool lunchbox::RefPtr< T >::operator> ( const RefPtr< T > &  rhs) const [inline]
Returns:
true if the right RefPtr is smaller then the left.
Version:
1.0

Definition at line 114 of file refPtr.h.


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