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

CTBgrab Class Template Reference

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

#include <CTBgrab.hxx>

List of all members.

Public Methods

void Construct (T *p_dst, T &src) const
void Destruct (T &dst, T *p_src) const
void Move (T *p_dst, T *p_src) const
void Swap (T &v1, T &v2) const
void operator() (T &dst, T &src) const


Detailed Description

template<class T>
class CTBgrab< T >

Function object for the `grab or copy' paradigma.

In some cases an object is copied just before it becomes obsolete or is destroyed. For heavy objects it is in these cases often substantially faster to use the grab paradigm rather than a simple copy.

In templatized classes one faces the problem to use depending on the type of the object either the grab or the copy approach.

The classes CTBgrab and a helper class CTBgrabable provide a function object interface for such a `grab or copy' functionality:

Requirements:

Definition at line 17 of file CTBgrab.hxx.


Member Function Documentation

template<class T>
void CTBgrab< T >::Construct T * p_dst,
T & src
const [inline]
 

Placement copy construct an object at p_dst with src.

Definition at line 76 of file CTBgrab.icc.

Referenced by CTBrawBuffer::GrabConstruct(), and CTBrawBuffer::GrabConstructRange().

template<class T>
void CTBgrab< T >::Destruct T & dst,
T * p_src
const [inline]
 

Copy object at p_src to dst, placement destruct object at p_src.

Definition at line 86 of file CTBgrab.icc.

Referenced by CTBrawBuffer::GrabDestruct().

template<class T>
void CTBgrab< T >::Move T * p_dst,
T * p_src
const [inline]
 

Move an object from p_src to p_dst.

Placement copy construct an object at p_dst with p_src, than do a placement destruct at p_src.

Definition at line 101 of file CTBgrab.icc.

template<class T>
void CTBgrab< T >::Swap T & v1,
T & v2
const [inline]
 

Exchange contents of v1 and v2.

Definition at line 112 of file CTBgrab.icc.

Referenced by CTBswap(), and CTBsortQ::operator()().

template<class T>
void CTBgrab< T >::operator() T & dst,
T & src
const [inline]
 

Copy src to dst.

Definition at line 124 of file CTBgrab.icc.


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