10#ifndef MI_BASE_STD_ALLOCATOR_H
11#define MI_BASE_STD_ALLOCATOR_H
76 : m_alloc( other.get_allocator()) {}
121 return m_alloc == other.get_allocator();
130 return ! ((*this) == other);
A default allocator implementation based on global new and delete.
Definition: default_allocator.h:38
The IAllocator interface class supports allocating and releasing memory dynamically.
Definition: iallocator.h:49
An adaptor class template that implements a standard STL allocator.
Definition: std_allocator.h:36
Default allocator implementation based on global new and delete.
size_type max_size() const
Returns the maximum number of elements of type T that can be allocated using this allocator.
Definition: std_allocator.h:102
T * pointer
Pointer type.
Definition: std_allocator.h:42
Std_allocator()
Default constructor.
Definition: std_allocator.h:60
std::size_t size_type
Size type.
Definition: std_allocator.h:46
const T * const_pointer
Const pointer type.
Definition: std_allocator.h:43
void destroy(pointer p)
Calls the destructor of T on the location p.
Definition: std_allocator.h:109
pointer address(reference x) const
Returns address of object x allocated through this allocator.
Definition: std_allocator.h:79
IAllocator * get_allocator() const
Returns the interface of the underlying allocator.
Definition: std_allocator.h:112
virtual void * malloc(Size size)=0
Allocates a memory block of the given size.
T & reference
Reference type.
Definition: std_allocator.h:44
void deallocate(pointer p, size_type)
Frees uninitialized dynamic memory at location p that has previously been allocated with allocate().
Definition: std_allocator.h:96
const T & const_reference
Const reference type.
Definition: std_allocator.h:45
T value_type
Value type allocated by this allocator.
Definition: std_allocator.h:41
Std_allocator<T1> other
Rebind type, defines a new class instance of this allocator template instantiated for the new value t...
Definition: std_allocator.h:54
static IAllocator * get_instance()
Returns the single instance of the default allocator.
Definition: default_allocator.h:69
const_pointer address(const_reference x) const
Returns const address of object x allocated through this allocator.
Definition: std_allocator.h:82
void construct(pointer p, const_reference value)
Calls the copy constructor of T on the location p with the argument value.
Definition: std_allocator.h:106
Std_allocator(base::IAllocator *allocator)
Constructor.
Definition: std_allocator.h:70
T * allocate(size_type n, const void *=0)
Allocate uninitialized dynamic memory for n elements of type T.
Definition: std_allocator.h:87
bool operator!=(Std_allocator<T2> other) const
Inequality comparison.
Definition: std_allocator.h:129
std::ptrdiff_t difference_type
Difference type.
Definition: std_allocator.h:47
bool operator==(Std_allocator<T2> other) const
Equality comparison.
Definition: std_allocator.h:120
Std_allocator(const Std_allocator<T1> &other)
Copying constructor template for alike allocators of different value type.
Definition: std_allocator.h:75
virtual void free(void *memory)=0
Releases the given memory block.
static const Size SIZE_MAX_VALUE
The maximum value for Size.
Definition: types.h:140
Allocator interface class to dynamically allocate and deallocate memory.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: math.h:22
Rebind helper struct to define a new class instance of this allocator template instantiated for the n...
Definition: std_allocator.h:51