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

CTBclone Class Template Reference

Function object for the `clone or copy' paradigma. More...

#include <CTBclone.hxx>

List of all members.

Public Methods

Toperator() (const T &src) const


Detailed Description

template<class T>
class CTBclone< T >

Function object for the `clone or copy' paradigma.

Often the need arises to duplicate an object. In many cases a simple copy construct is sufficient. However, this is not possible if the object is for example only known through a pointer to a base class. In those cases the object can't be copied but must be cloned.

In templatized classes one faces the problem to use depending on the type of the object either the copy or the clone approach, the former for simple classes which don't have a clone method, the later for example for abstract base classes.

The classes CTBclone and a helper class CTBcloneable provide a function object interface for such a `clone or copy' functionality:

Requirements:

Definition at line 17 of file CTBclone.hxx.


Member Function Documentation

template<class T>
T * CTBclone< T >::operator() const T & src const [inline]
 

Create a new object of type T as a copy of src.

Definition at line 68 of file CTBclone.icc.


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