nub::ref< T > Class Template Reference

#include <nub/ref.h>

Collaboration diagram for nub::ref< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ref (nub::uid i)
 ref (T *ptr, ref_vis vis=DEFAULT)
template<class U >
 ref (const ref< U > &other)
template<class U >
 ref (const soft_ref< U > &other)
void reset (T *p)
 Shorthand for assignment.
T * operator-> () const throw ()
T & operator* () const throw ()
T * get () const throw ()
bool operator== (const ref &other) const throw ()
bool operator!= (const ref &other) const throw ()
nub::uid id () const throw ()
bool operator< (const ref &other) const throw ()
 Comparison operator for sorting.

Detailed Description

template<class T>
class nub::ref< T >

nub::ref<T> is a ref-counted smart pointer for holding ref_counted objects. A nub::ref<T> is guaranteed to always point to a valid ref_counted object, and uses ref_counted's strong ref counts to achieve this. In order to provide this guarantee, it is possible that construction of a nub::ref<T> may throw an exception. For example, a nub::ref<T> cannot be constructed for a volatlie ref_counted object for which only weak references are available.

Definition at line 134 of file ref.h.


Member Function Documentation

template<class T>
bool nub::ref< T >::operator< ( const ref< T > &  other  )  const throw () [inline]

Comparison operator for sorting.

E.g. to allow insertion into std::map or std::set, etc.

Definition at line 184 of file ref.h.

template<class T>
void nub::ref< T >::reset ( T *  p  )  [inline]

The documentation for this class was generated from the following file:
Generated on Sun May 8 08:30:53 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3