Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

Object Management Trickery

These functions are to construct and destruct objects in memory without causing a free or malloc call to occur. More...

Functions

template<class T> T * constructInPlace (T *p)
 Constructs an object that already has memory allocated for it.

template<class T> T * constructInPlace (T *p, const T *copy)
 Copy constructs an object that already has memory allocated for it.

template<class T> void destructInPlace (T *p)
 Destructs an object without freeing the memory associated with it.


Detailed Description

These functions are to construct and destruct objects in memory without causing a free or malloc call to occur.

This is so that we don't have to worry about allocating, say, space for a hundred NetAddresses with a single malloc call, calling delete on a single NetAdress, and having it try to free memory out from under us.


Generated on Thu Aug 18 16:03:36 2005 for Robin Hood: Thieves & Knights by doxygen1.2.18