Embedded Multicore Building Blocks V1.0.0
|
Allocator according to the C++ standard. More...
#include <memory_allocation.h>
Classes | |
struct | rebind |
Rebind allocator to type OtherType. More... | |
Public Types | |
typedef size_t | size_type |
Quantity of elements type. More... | |
typedef ptrdiff_t | difference_type |
Difference between two pointers type. More... | |
typedef Type * | pointer |
Pointer to element type. More... | |
typedef const Type * | const_pointer |
Pointer to constant element type. More... | |
typedef Type & | reference |
Reference to element type. More... | |
typedef const Type & | const_reference |
Reference to constant element type. More... | |
typedef Type | value_type |
Element type. More... | |
Public Member Functions | |
Allocator () throw () | |
Constructs allocator object. More... | |
Allocator (const Allocator &) throw () | |
Copies allocator object. More... | |
template<typename OtherType > | |
Allocator (const Allocator< OtherType > &) throw () | |
Constructs allocator object. More... | |
~Allocator () throw () | |
Destructs allocator object. More... | |
pointer | address (reference x) const |
Gets address of an object. More... | |
const_pointer | address (const_reference x) const |
Gets address of a constant object. More... | |
pointer | allocate (size_type n, const void *=0) |
Allocates but doesn't initialize storage for elements of type Type. More... | |
void | deallocate (pointer p, size_type) |
Deallocates storage of destroyed elements. More... | |
size_type | max_size () const throw () |
Allocation maximum More... | |
void | construct (pointer p, const value_type &val) |
Initializes elements of allocated storage with specified value. More... | |
void | destroy (pointer p) |
Destroys elements of initialized storage. More... | |
Allocator according to the C++ standard.
For memory allocation and deallocation, embb::base::Allocation::Allocate() and embb::base::Allocation::Free() are used, respectively.
In debug mode, leak checking is active. The function embb::base::Allocation::AllocatedBytes() returns the number of currently allocated bytes.
typedef size_t embb::base::Allocator< Type >::size_type |
Quantity of elements type.
typedef ptrdiff_t embb::base::Allocator< Type >::difference_type |
Difference between two pointers type.
typedef Type* embb::base::Allocator< Type >::pointer |
Pointer to element type.
typedef const Type* embb::base::Allocator< Type >::const_pointer |
Pointer to constant element type.
typedef Type& embb::base::Allocator< Type >::reference |
Reference to element type.
typedef const Type& embb::base::Allocator< Type >::const_reference |
Reference to constant element type.
typedef Type embb::base::Allocator< Type >::value_type |
Element type.
embb::base::Allocator< Type >::Allocator | ( | ) | ||
throw | ( | |||
) |
Constructs allocator object.
embb::base::Allocator< Type >::Allocator | ( | const Allocator< Type > & | ) | ||
throw | ( | ||||
) |
Copies allocator object.
embb::base::Allocator< Type >::Allocator | ( | const Allocator< OtherType > & | ) | ||
throw | ( | ||||
) |
Constructs allocator object.
Allows construction from allocators for different types (rebind)
embb::base::Allocator< Type >::~Allocator | ( | ) | ||
throw | ( | |||
) |
Destructs allocator object.
pointer embb::base::Allocator< Type >::address | ( | reference | x | ) | const |
Gets address of an object.
[in] | x | Reference to object |
const_pointer embb::base::Allocator< Type >::address | ( | const_reference | x | ) | const |
Gets address of a constant object.
[in] | x | Reference to constant object |
pointer embb::base::Allocator< Type >::allocate | ( | size_type | n, |
const void * | = 0 |
||
) |
Allocates but doesn't initialize storage for elements of type Type.
[in] | n | Number of elements to allocate |
void embb::base::Allocator< Type >::deallocate | ( | pointer | p, |
size_type | |||
) |
Deallocates storage of destroyed elements.
[in,out] | p | Pointer to allocated storage |
size_type embb::base::Allocator< Type >::max_size | ( | ) | const | |
throw | ( | |||
) |
Allocation maximum
void embb::base::Allocator< Type >::construct | ( | pointer | p, |
const value_type & | val | ||
) |
Initializes elements of allocated storage with specified value.
[in,out] | p | Pointer to allocated storage |
[in] | val | Value |
void embb::base::Allocator< Type >::destroy | ( | pointer | p | ) |
Destroys elements of initialized storage.
[in,out] | p | Pointer to allocated storage |