Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

SH::RPtr< T > Class Template Reference

#include <SHRPtr.h>

Inheritance diagram for SH::RPtr< T >:

Inheritance graph
[legend]
Collaboration diagram for SH::RPtr< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RPtr ()
 RPtr (T *pointee)
 RPtr (const RPtr &other)
RPtroperator= (const RPtr &other)
RPtroperator= (T *pointee)
 ~RPtr ()
T & operator * () const
T * operator-> () const
T * pointer () const
bool isNull () const

Detailed Description

template<class T>
class SH::RPtr< T >

A specialized smart pointer for handling of reports. It is a kind of smart pointer that allows an unlimited number of pointer to the same object with auto-deletion when all pointers are forgotten. It is intended as a replacement for the interfaces that use Report*& and demand that the receiver sets the pointer to NULL if it is consumed. If the user wants an actual copy, the clone function of the Report object must be called. Even that may not result in a true copy, but a different writable object is created, while this smart pointer does not support copy-on-write (that is something that smart pointers can not do).


Constructor & Destructor Documentation

template<class T>
SH::RPtr< T >::RPtr  )  [inline]
 

template<class T>
SH::RPtr< T >::RPtr T *  pointee  )  [inline, explicit]
 

This constructor swallows an externally provided pointer and consumes it. Since the number of copies maintained by this smart pointer is set to 1, deletion of this smart pointer will trigger a call to the release function of the pointee. This means that the pointer that is provided for constructing this object would become invalid at the latest when the last RPtr is deleted. To make this slightly more deterministic, the pointee that is used for the construction of the smart pointer is deleted immediately.

template<class T>
SH::RPtr< T >::RPtr const RPtr< T > &  other  )  [inline]
 

template<class T>
SH::RPtr< T >::~RPtr  )  [inline]
 


Member Function Documentation

template<class T>
bool SH::RPtr< T >::isNull  )  const [inline]
 

template<class T>
T& SH::RPtr< T >::operator *  )  const [inline]
 

template<class T>
T* SH::RPtr< T >::operator->  )  const [inline]
 

template<class T>
RPtr& SH::RPtr< T >::operator= T *  pointee  )  [inline]
 

template<class T>
RPtr& SH::RPtr< T >::operator= const RPtr< T > &  other  )  [inline]
 

template<class T>
T* SH::RPtr< T >::pointer  )  const [inline]
 


The documentation for this class was generated from the following file:
Generated on Sun Mar 6 13:36:36 2005 for Komssys by doxygen 1.3.8