10#ifndef MI_BASE_STD_ALLOCATOR_H
11#define MI_BASE_STD_ALLOCATOR_H
77 : m_alloc( other.get_allocator()) {}
125 return m_alloc == other.get_allocator();
135 return ! ((*this) == other);
Allocator interface class to dynamically allocate and deallocate memory.
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.
bool operator!=(Std_allocator<T2> other) const noexcept
Inequality comparison.
Definition: std_allocator.h:133
T * pointer
Pointer type.
Definition: std_allocator.h:42
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:112
pointer address(reference x) const
Returns address of object x allocated through this allocator.
Definition: std_allocator.h:80
IAllocator * get_allocator() const
Returns the interface of the underlying allocator.
Definition: std_allocator.h:115
virtual void * malloc(Size size)=0
Allocates a memory block of the given size.
T value_type
Value type allocated by this allocator.
Definition: std_allocator.h:41
T * allocate(size_type n, const void *=nullptr) noexcept
Allocate uninitialized dynamic memory for n elements of type T.
Definition: std_allocator.h:88
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:98
Std_allocator(const Std_allocator<T1> &other) noexcept
Copying constructor template for alike allocators of different value type.
Definition: std_allocator.h:76
Std_allocator() noexcept
Default constructor.
Definition: std_allocator.h:61
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:83
std::size_t size_type
Size type.
Definition: std_allocator.h:46
std::ptrdiff_t difference_type
Difference type.
Definition: std_allocator.h:47
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:109
Std_allocator(base::IAllocator *allocator) noexcept
Constructor.
Definition: std_allocator.h:71
const T & const_reference
Const reference type.
Definition: std_allocator.h:45
bool operator==(Std_allocator<T2> other) const noexcept
Equality comparison.
Definition: std_allocator.h:123
virtual void free(void *memory)=0
Releases the given memory block.
size_type max_size() const noexcept
Returns the maximum number of elements of type T that can be allocated using this allocator.
Definition: std_allocator.h:105
static const Size SIZE_MAX_VALUE
The maximum value for Size.
Definition: types.h:140
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: example_derivatives.dox:5
Rebind helper struct to define a new class instance of this allocator template instantiated for the n...
Definition: std_allocator.h:52