cheshirekow
v0.1.0
|
template for allocators & memory managers More...
#include <mpblocks/clarkson93/ExampleTraits2.h>
Public Types | |
typedef std::vector< Simplex > | base_t |
Public Member Functions | |
SimplexRef | 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 159 of file ExampleTraits2.h.
typedef std::vector<Simplex> mpblocks::clarkson93::ExampleTraits2< SCALAR, NDIM >::SimplexMgr::base_t |
Definition at line 162 of file ExampleTraits2.h.
|
inline |
construct an object of type T using the next available memory
Definition at line 166 of file ExampleTraits2.h.