eq::base::RefPtr< T > Class Template Reference

A smart reference pointer. More...

#include <refPtr.h>

Collaboration diagram for eq::base::RefPtr< T >:

Collaboration graph
[legend]

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.
 ~RefPtr ()
 Destruct this reference pointer.
void ref ()
 Artificially reference the held object.
void unref ()
 Artificially dereference the held object.
RefPtroperator= (const RefPtr &rhs)
 Assign another reference pointer 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
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 eq::base::RefPtr< T >

A smart reference pointer.

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

Definition at line 37 of file refPtr.h.


Constructor & Destructor Documentation

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

Construct a new, empty reference pointer.

Definition at line 41 of file refPtr.h.

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

Construct a reference pointer from a C pointer.

Definition at line 43 of file refPtr.h.

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

Construct a copy of a reference pointer.

Definition at line 45 of file refPtr.h.

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

Destruct this reference pointer.

Definition at line 47 of file refPtr.h.


Member Function Documentation

template<class T>
void eq::base::RefPtr< T >::ref (  )  [inline]

Artificially reference the held object.

Definition at line 50 of file refPtr.h.

Referenced by eq::base::RefPtr< SharedData >::operator=(), and eq::base::RefPtr< SharedData >::RefPtr().

Here is the caller graph for this function:

template<class T>
void eq::base::RefPtr< T >::unref (  )  [inline]

Artificially dereference the held object.

Definition at line 53 of file refPtr.h.

Referenced by eq::base::RefPtr< SharedData >::~RefPtr().

Here is the caller graph for this function:

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

Assign another reference pointer to this reference pointer.

Definition at line 69 of file refPtr.h.

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

Assign a C pointer to this reference pointer.

Definition at line 82 of file refPtr.h.

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

Returns:
true if both reference pointers hold the same C pointer

Definition at line 95 of file refPtr.h.

template<class T>
bool eq::base::RefPtr< T >::operator!= ( const RefPtr< T > &  rhs  )  const [inline]

Returns:
true if both reference pointer hold different C pointer

Definition at line 98 of file refPtr.h.

template<class T>
bool eq::base::RefPtr< T >::operator< ( const RefPtr< T > &  rhs  )  const [inline]

Returns:
true if the left RefPtr is smaller then the right.

Definition at line 101 of file refPtr.h.

template<class T>
bool eq::base::RefPtr< T >::operator> ( const RefPtr< T > &  rhs  )  const [inline]

Returns:
true if the right RefPtr is smaller then the left.

Definition at line 104 of file refPtr.h.

template<class T>
bool eq::base::RefPtr< T >::operator! (  )  const [inline]

Returns:
true if the RefPtr is empty.

Definition at line 107 of file refPtr.h.

template<class T>
bool eq::base::RefPtr< T >::operator== ( const T *  ptr  )  const [inline]

Returns:
true if the reference pointers holds the C pointer

Definition at line 110 of file refPtr.h.

template<class T>
bool eq::base::RefPtr< T >::operator!= ( const T *  ptr  )  const [inline]

Returns:
true if the reference pointers does not hold the C pointer

Definition at line 112 of file refPtr.h.

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

Access the held object.

Definition at line 115 of file refPtr.h.

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

Access the held object.

Definition at line 118 of file refPtr.h.

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

Access the held object.

Definition at line 121 of file refPtr.h.

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

Access the held object.

Definition at line 124 of file refPtr.h.

template<class T>
T* eq::base::RefPtr< T >::get (  )  [inline]

template<class T>
const T* eq::base::RefPtr< T >::get (  )  const [inline]

Returns:
the C pointer.

Definition at line 130 of file refPtr.h.

template<class T>
bool eq::base::RefPtr< T >::isValid (  )  const [inline]

Returns:
true if the RefPtr holds a non-NULL pointer.

Definition at line 133 of file refPtr.h.

Referenced by eq::net::Object::becomeMaster(), eq::net::Node::connect(), eq::net::Barrier::enter(), eq::net::Session::notifyMapped(), eq::releaseConfig(), eq::net::Connection::setDescription(), and eq::net::Session::unmapObject().

Here is the caller graph for this function:


The documentation for this class was generated from the following file:
Generated on Mon Aug 10 18:58:44 2009 for Equalizer 0.9 by  doxygen 1.5.8