Object Management Trickery
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.
|
Functions |
| template<class T> T * | TNL::constructInPlace (T *p) |
| | Constructs an object that already has memory allocated for it.
|
| template<class T> T * | TNL::constructInPlace (T *p, const T *copy) |
| | Copy constructs an object that already has memory allocated for it.
|
| template<class T> void | TNL::destructInPlace (T *p) |
| | Destructs an object without freeing the memory associated with it.
|
Function Documentation
|
template<class T> |
| T* constructInPlace |
( |
T * |
p |
) |
[inline] |
|
|
|
Constructs an object that already has memory allocated for it.
|
|
template<class T> |
| T* constructInPlace |
( |
T * |
p, |
|
|
const T * |
copy |
|
) |
[inline] |
|
|
|
Copy constructs an object that already has memory allocated for it.
|
|
template<class T> |
| void destructInPlace |
( |
T * |
p |
) |
[inline] |
|
|
|
Destructs an object without freeing the memory associated with it.
|