cheshirekow
v0.1.0
|
template for allocators & memory managers More...
#include <mpblocks/clarkson93/ExampleTraits.h>
Public Types | |
typedef std::vector< Simplex > | Base |
Public Member Functions | |
Simplex * | create () |
construct an object of type T using the next available memory More... | |
template for allocators & memory managers
The triangulation doesn't support removal of points. Thus simplices are never deleted individually (rather, all at once when the triangulation is cleared). Thus we divert memory management to the user of the libary. The allocator is responsible for keeping track of every object it allocates an be delete them all when cleared
This example preallocates a fixed size array of storage for objects. When create() is called it takes the next unused pointers, calls in-place operator new() and then returns the pointer. When it is reset, it goes through the list of allocated pointers and calls the destructor (ptr)->~T() on each of them.
For the most part, Alloc<T> is only used to construct POD types so this is a bit of a moot point.
Definition at line 155 of file ExampleTraits.h.
typedef std::vector<Simplex> mpblocks::clarkson93::ExampleTraits::SimplexFactory::Base |
Definition at line 158 of file ExampleTraits.h.
|
inline |
construct an object of type T using the next available memory
Definition at line 162 of file ExampleTraits.h.