version 3.3

VRS::SO< T > Class Template Reference

Smart pointers for shareable objects of type T (T must be derived from class VRS::SharedObj). More...

#include <vrs/so.h>

List of all members.

Public Types

typedef T Type

Public Member Functions

 SO ()
 SO (T *obj)
 SO (const SO &so)
 SO (const WO< T > &wo)
 ~SO ()
SOoperator= (T *obj)
SOoperator= (const SO &so)
SOoperator= (const WO< T > &wo)
template<class S>
SOoperator= (const SO< S > &so)
bool operator< (const T *obj) const
bool operator< (const SO &so) const
 operator T * () const
T * operator-> () const
T & operator* () const
template<class S>
 operator SO< S > ()
 operator WO< T > ()

Friends

bool operator< (const T *obj1, const SO &so2)


Detailed Description

template<class T>
class VRS::SO< T >

Smart pointers for shareable objects of type T (T must be derived from class VRS::SharedObj).

Member Typedef Documentation

template<class T>
typedef T VRS::SO< T >::Type


Constructor & Destructor Documentation

template<class T>
VRS::SO< T >::SO (  )  [inline]

template<class T>
VRS::SO< T >::SO ( T *  obj  )  [inline]

template<class T>
VRS::SO< T >::SO ( const SO< T > &  so  )  [inline]

template<class T>
VRS::SO< T >::SO ( const WO< T > &  wo  )  [inline]

template<class T>
VRS::SO< T >::~SO (  )  [inline]

SO<T> represent a smart pointer for a shared object of type "T" (T must be derived from class VRS::SharedObj). If a smart pointer is constructed, and an object pointer is passed as argument, the object is referenced (i.e. the ref counter is incremented by one). If the smart pointer is destructed, and an object pointer has been assigned, the object is dereferenced (i.e. the ref counter is decremented by one).


Member Function Documentation

template<class T>
SO& VRS::SO< T >::operator= ( T *  obj  )  [inline]

template<class T>
SO& VRS::SO< T >::operator= ( const SO< T > &  so  )  [inline]

template<class T>
SO& VRS::SO< T >::operator= ( const WO< T > &  wo  )  [inline]

template<class T>
template<class S>
SO& VRS::SO< T >::operator= ( const SO< S > &  so  )  [inline]

template<class T>
bool VRS::SO< T >::operator< ( const T *  obj  )  const [inline]

< If a shared object pointer is assigned to the smart pointer, the current object is dereferenced (if there is a current object at all), and the new object is referenced.

template<class T>
bool VRS::SO< T >::operator< ( const SO< T > &  so  )  const [inline]

template<class T>
VRS::SO< T >::operator T * (  )  const [inline]

template<class T>
T* VRS::SO< T >::operator-> (  )  const [inline]

template<class T>
T& VRS::SO< T >::operator* (  )  const [inline]

Implicit conversion to "T*" is supported. Smart pointers can be dereferenced using the common operators "->" and "*" for "normal" pointers, too.

template<class T>
template<class S>
VRS::SO< T >::operator SO< S > (  )  [inline]

A smart pointer SO<T> can be converted to a smart pointer SO<S>, if T is derived from S.

template<class T>
VRS::SO< T >::operator WO< T > (  )  [inline]

A smart pointer SO<T> can be converted to a weak pointer WO<T>.


Friends And Related Function Documentation

template<class T>
bool operator< ( const T *  obj1,
const SO< T > &  so2 
) [friend]

Shared object pointers can be compared with respect to the addresses they are pointing to.


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

Generated on Mon May 20 06:00:38 2013 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact