![]() |
Protium
Math and Design Features
|
Allocator to be used by STL containers. More...
#include <STLAdapter.h>
Classes | |
struct | rebind |
Allows Adapters to use each other. More... | |
Public Types | |
typedef const Host * | const_hostPointer |
typedef const Host & | const_hostRef |
typedef const Host * | const_pointer |
Const Pointer to host type. More... | |
typedef const Host & | const_reference |
Const Reference to host type. More... | |
typedef std::ptrdiff_t | difference_type |
Type to be used when calculating distance between pointers. More... | |
typedef Host * | hostPointer |
typedef Host & | hostRef |
typedef Host * | pointer |
Pointer type to host type. More... | |
typedef Host & | reference |
Reference to host type. More... | |
typedef std::size_t | size_type |
Size to be used in allocation. More... | |
typedef Host | value_type |
Host Type. More... | |
Public Member Functions | |
STLAdapter () throw () | |
Default constuctor does nothing. More... | |
STLAdapter (const STLAdapter &) throw () | |
Copy constructor utilizes nothing. More... | |
template<typename T > | |
STLAdapter (const STLAdapter< T > &) throw () | |
Templated copy constructor does nothing. More... | |
~STLAdapter () throw () | |
Nothing to destruct. More... | |
Host * | address (Host &elem) const |
Returns the address of the host object. More... | |
const Host * | address (const Host &elem) const |
Returns the const address of the host object. More... | |
Host * | allocate (std::size_t count, const void *hint=0) |
Allocates out a host object type. More... | |
void | construct (Host *p, const Host &value) |
Constructs a copy host instance at the pointer. More... | |
void | deallocate (Host *p, std::size_t size) |
Deallocates host objects up to size. More... | |
void | destroy (Host *p) |
Destructs the host instance at p. More... | |
std::size_t | max_size () const throw () |
Returns the maximum number of objects that can be allocated at once. More... | |
Allocator to be used by STL containers.
Host | CRTP style template. Use like: std::vector<MyClass, STLAdapter<MyClass> > |
AllocType | use if SmallObject uses custom Allocator |
Definition at line 17 of file STLAdapter.h.
typedef const Host* Protium::Allocation::STLAdapter< Host, AllocType >::const_hostPointer |
Definition at line 41 of file STLAdapter.h.
typedef const Host& Protium::Allocation::STLAdapter< Host, AllocType >::const_hostRef |
Definition at line 43 of file STLAdapter.h.
typedef const Host* Protium::Allocation::STLAdapter< Host, AllocType >::const_pointer |
Const Pointer to host type.
Definition at line 29 of file STLAdapter.h.
typedef const Host& Protium::Allocation::STLAdapter< Host, AllocType >::const_reference |
Const Reference to host type.
Definition at line 35 of file STLAdapter.h.
typedef std::ptrdiff_t Protium::Allocation::STLAdapter< Host, AllocType >::difference_type |
Type to be used when calculating distance between pointers.
Definition at line 23 of file STLAdapter.h.
typedef Host* Protium::Allocation::STLAdapter< Host, AllocType >::hostPointer |
Definition at line 40 of file STLAdapter.h.
typedef Host& Protium::Allocation::STLAdapter< Host, AllocType >::hostRef |
Definition at line 42 of file STLAdapter.h.
typedef Host* Protium::Allocation::STLAdapter< Host, AllocType >::pointer |
Pointer type to host type.
Definition at line 26 of file STLAdapter.h.
typedef Host& Protium::Allocation::STLAdapter< Host, AllocType >::reference |
Reference to host type.
Definition at line 32 of file STLAdapter.h.
typedef std::size_t Protium::Allocation::STLAdapter< Host, AllocType >::size_type |
Size to be used in allocation.
Definition at line 20 of file STLAdapter.h.
typedef Host Protium::Allocation::STLAdapter< Host, AllocType >::value_type |
Host Type.
Definition at line 38 of file STLAdapter.h.
|
inline |
Default constuctor does nothing.
Definition at line 46 of file STLAdapter.h.
|
inline |
Copy constructor utilizes nothing.
Definition at line 49 of file STLAdapter.h.
|
inline |
Templated copy constructor does nothing.
Definition at line 53 of file STLAdapter.h.
|
inline |
Nothing to destruct.
Definition at line 56 of file STLAdapter.h.
|
inline |
Returns the address of the host object.
Definition at line 65 of file STLAdapter.h.
|
inline |
Returns the const address of the host object.
Definition at line 68 of file STLAdapter.h.
|
inline |
Allocates out a host object type.
Definition at line 71 of file STLAdapter.h.
|
inline |
Constructs a copy host instance at the pointer.
Definition at line 90 of file STLAdapter.h.
|
inline |
Deallocates host objects up to size.
Definition at line 78 of file STLAdapter.h.
|
inline |
Destructs the host instance at p.
Definition at line 95 of file STLAdapter.h.
|
inline |
Returns the maximum number of objects that can be allocated at once.
Definition at line 83 of file STLAdapter.h.