cheshirekow  v0.1.0
mpblocks::clarkson93::ExampleTraits2< SCALAR, NDIM >::SimplexMgr Struct Reference

template for allocators & memory managers More...

#include <mpblocks/clarkson93/ExampleTraits2.h>

Inheritance diagram for mpblocks::clarkson93::ExampleTraits2< SCALAR, NDIM >::SimplexMgr:

Public Types

typedef std::vector< Simplexbase_t
 

Public Member Functions

SimplexRef create ()
 construct an object of type T using the next available memory More...
 

Detailed Description

template<typename SCALAR, unsigned int NDIM>
struct mpblocks::clarkson93::ExampleTraits2< SCALAR, NDIM >::SimplexMgr

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.

Note
: Alloc must be default constructable. It will be passed to setup.prepare( Alloc<T> ) so if you need to do any allocator initialization you must do it in Setup

Definition at line 159 of file ExampleTraits2.h.

Member Typedef Documentation

template<typename SCALAR , unsigned int NDIM>
typedef std::vector<Simplex> mpblocks::clarkson93::ExampleTraits2< SCALAR, NDIM >::SimplexMgr::base_t

Definition at line 162 of file ExampleTraits2.h.

Member Function Documentation

template<typename SCALAR , unsigned int NDIM>
SimplexRef mpblocks::clarkson93::ExampleTraits2< SCALAR, NDIM >::SimplexMgr::create ( void  )
inline

construct an object of type T using the next available memory

Definition at line 166 of file ExampleTraits2.h.


The documentation for this struct was generated from the following file: