Implements allocator requirements as defined in ISO C++ Standard 2003, section 20.1.5. More...
#include <Base_Allocator.hxx>
Public Types | |
typedef T | value_type |
Defines a value type. | |
typedef value_type * | pointer |
Defines a value pointer type. | |
typedef const value_type * | const_pointer |
Defines a const value pointer type. | |
typedef value_type & | reference |
Defines a value reference type. | |
typedef const value_type & | const_reference |
Defines a const value reference type. | |
typedef size_t | size_type |
Defines a size type. | |
typedef ptrdiff_t | difference_type |
Defines a pointer difference type. | |
typedef std::true_type | propagate_on_container_move_assignment |
Defines whether contents move is allowed on container move assignment. | |
Public Member Functions | |
Base_Allocator () throw () | |
Constructor. | |
Base_Allocator (const Base_Allocator &) throw () | |
Constructor. | |
~Base_Allocator () throw () | |
Destructor. | |
template<typename U > | |
Base_Allocator (const Base_Allocator< U > &) throw () | |
Constructor. | |
pointer | address (reference x) const |
Returns an object address. | |
const_pointer | address (const_reference x) const |
Returns an object address. | |
pointer | allocate (size_type n, const void *=0) |
Allocates memory for n objects. | |
void | deallocate (pointer p, size_type) |
Frees previously allocated memory. | |
size_type | max_size () const throw () |
Returns the largest value for which method allocate might succeed. | |
void | construct (pointer p, const_reference val) |
Constructs an object. | |
void | construct (pointer p, T &&val) |
Constructs an object. | |
template<typename U > | |
void | construct (pointer p, U &&val) |
Constructs an object. | |
void | destroy (pointer p) |
Destroys the object. | |
Implements allocator requirements as defined in ISO C++ Standard 2003, section 20.1.5.
The allocator uses cadex_alloc(), cadex_free(). The allocator can be used with standard containers (std::vector, std::map, etc) to take advantage of CAD Exchanger allocator.
Example of use:
|
inline |
Constructor.
Empty constructor.
|
inline |
Constructor.
Empty constructor.
|
inline |
Destructor.
Empty implementation.
|
inline |
Constructor.
Empty constructor.
|
inline |
Returns an object address.
Returns &x.
|
inline |
Returns an object address.
Returns &x.
|
inline |
Allocates memory for n objects.
Uses underlying allocator to allocate memory.
|
inline |
Constructs an object.
Uses placement new operator and copy constructor to construct an object.
|
inline |
Constructs an object.
Uses placement new operator and move constructor to construct an object.
|
inline |
Constructs an object.
Uses placement new operator and universal constructor to construct an object.
|
inline |
Frees previously allocated memory.
Uses underlying allocator to deallocate memory.
|
inline |
Destroys the object.
Uses object destructor.