Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

CTBclonedObjPtr Class Template Reference

Cloned object pointer. More...

#include <CTBclonedObjPtr.hxx>

Inheritance diagram for CTBclonedObjPtr:

Inheritance graph
[legend]
Collaboration diagram for CTBclonedObjPtr:

Collaboration graph
[legend]
List of all members.

Public Methods

 CTBclonedObjPtr ()
 CTBclonedObjPtr (const CTBclonedObjPtr< T > &rhs)
 CTBclonedObjPtr (T *p)
CTBclonedObjPtr< T > & operator= (const CTBclonedObjPtr< T > &rhs)
CTBclonedObjPtr< T > & operator= (T *rhs)

Detailed Description

template<class T>
class CTBclonedObjPtr< T >

Cloned object pointer.

Like CTBownedBObjPtr, but copy constructor and the assignment operator are defined to replicate the controlled object of the source pointer.

Applicability:
This pointer class works with every type that can be copied or cloned, either with a copy constructor or via a Clone() function. The replication is encapsulated in the CTBclone interface. Note that this allows to use a CTBclonedObjPtr even for abstract base classes.
Requirements:

Definition at line 19 of file CTBclonedObjPtr.hxx.


Constructor & Destructor Documentation

template<class T>
CTBclonedObjPtr< T >::CTBclonedObjPtr [inline]
 

Default constructor.

Definition at line 40 of file CTBclonedObjPtr.icc.

template<class T>
CTBclonedObjPtr< T >::CTBclonedObjPtr const CTBclonedObjPtr< T > & rhs [inline]
 

Copy constructor.

The object controlled by rhs is replicated with the Clone() function and reference to the new object will be the controlled object of this pointer.

Definition at line 52 of file CTBclonedObjPtr.icc.

template<class T>
CTBclonedObjPtr< T >::CTBclonedObjPtr T * p [inline]
 

Construct from pointer.

The object refered to by p becomes the controlled object.

Definition at line 66 of file CTBclonedObjPtr.icc.


Member Function Documentation

template<class T>
CTBclonedObjPtr< T > & CTBclonedObjPtr< T >::operator= const CTBclonedObjPtr< T > & rhs [inline]
 

Replicate controlled object of rhs.

The object controlled by rhs is replicated with the Clone() function and reference to the new object will be the controlled object of this pointer.

Definition at line 78 of file CTBclonedObjPtr.icc.

template<class T>
CTBclonedObjPtr< T > & CTBclonedObjPtr< T >::operator= T * rhs [inline]
 

Make rhs the controlled object.

Reimplemented from CTBownedObjPtr.

Definition at line 93 of file CTBclonedObjPtr.icc.


The documentation for this class was generated from the following files:
Generated at Fri Oct 24 18:13:35 2003 for CTBbase by doxygen1.2.9-20010812 written by Dimitri van Heesch, © 1997-2001