Thrill  0.1
AlignedAllocator< Type, BaseAllocator, Alignment > Class Template Reference

Detailed Description

template<typename Type = char, typename BaseAllocator = std::allocator<char>, size_t Alignment = 4096>
class thrill::mem::AlignedAllocator< Type, BaseAllocator, Alignment >

Definition at line 43 of file aligned_allocator.hpp.

+ Inheritance diagram for AlignedAllocator< Type, BaseAllocator, Alignment >:
+ Collaboration diagram for AlignedAllocator< Type, BaseAllocator, Alignment >:

#include <aligned_allocator.hpp>

Classes

struct  rebind
 Return allocator for different type. More...
 

Public Types

using const_pointer = const Type *
 
using const_reference = const Type &
 
using difference_type = std::ptrdiff_t
 
using is_always_equal = std::false_type
 C++11 type flag. More...
 
using pointer = Type *
 
using reference = Type &
 
using size_type = std::size_t
 
using value_type = Type
 
- Public Types inherited from AllocatorBase< Type >
using const_pointer = const Type *
 
using const_reference = const Type &
 
using difference_type = std::ptrdiff_t
 
using is_always_equal = std::true_type
 C++11 type flag. More...
 
using pointer = Type *
 
using propagate_on_container_move_assignment = std::true_type
 C++11 type flag. More...
 
using reference = Type &
 
using size_type = std::size_t
 
using value_type = Type
 

Public Member Functions

 AlignedAllocator (const BaseAllocator &base=BaseAllocator())
 Construct with base allocator. More...
 
 AlignedAllocator (const AlignedAllocator &) noexcept=default
 copy-constructor More...
 
template<typename OtherType >
 AlignedAllocator (const AlignedAllocator< OtherType > &other) noexcept
 copy-constructor from a rebound allocator More...
 
pointer allocate (size_type n, const void *=nullptr)
 
void * allocate_bytes (size_t size, size_t meta_info_size=0)
 
const BaseAllocator & base () const
 
void deallocate (pointer p, size_type n) noexcept
 
void deallocate_bytes (void *ptr, size_t size, size_t meta_info_size=0) noexcept
 
template<typename Other >
bool operator!= (const AlignedAllocator< Other > &other) const noexcept
 Compare to another allocator of same type. More...
 
AlignedAllocatoroperator= (const AlignedAllocator &) noexcept=default
 copy-assignment operator More...
 
template<typename Other >
bool operator== (const AlignedAllocator< Other > &other) const noexcept
 Compare to another allocator of same type. More...
 
- Public Member Functions inherited from AllocatorBase< Type >
pointer address (reference x) const noexcept
 Returns the address of x. More...
 
const_pointer address (const_reference x) const noexcept
 Returns the address of x. More...
 
void construct (pointer p, const_reference value)
 Constructs an element object on the location pointed by p. More...
 
template<typename SubType , typename... Args>
void construct (SubType *p, Args &&... args)
 Constructs an element object on the location pointed by p. More...
 
void destroy (pointer p) const noexcept
 Destroys in-place the object pointed by p. More...
 
template<typename SubType >
void destroy (SubType *p) const noexcept
 Destroys in-place the object pointed by p. More...
 
size_type max_size () const noexcept
 Maximum size possible to allocate. More...
 

Private Attributes

BaseAllocator base_
 base allocator More...
 

Static Private Attributes

static constexpr bool debug = false
 

Member Typedef Documentation

◆ const_pointer

using const_pointer = const Type *

Definition at line 53 of file aligned_allocator.hpp.

◆ const_reference

using const_reference = const Type&

Definition at line 55 of file aligned_allocator.hpp.

◆ difference_type

using difference_type = std::ptrdiff_t

Definition at line 57 of file aligned_allocator.hpp.

◆ is_always_equal

using is_always_equal = std::false_type

C++11 type flag.

Definition at line 60 of file aligned_allocator.hpp.

◆ pointer

using pointer = Type *

Definition at line 52 of file aligned_allocator.hpp.

◆ reference

using reference = Type&

Definition at line 54 of file aligned_allocator.hpp.

◆ size_type

using size_type = std::size_t

Definition at line 56 of file aligned_allocator.hpp.

◆ value_type

using value_type = Type

Definition at line 51 of file aligned_allocator.hpp.

Constructor & Destructor Documentation

◆ AlignedAllocator() [1/3]

AlignedAllocator ( const BaseAllocator &  base = BaseAllocator())
inlineexplicit

Construct with base allocator.

Definition at line 67 of file aligned_allocator.hpp.

◆ AlignedAllocator() [2/3]

AlignedAllocator ( const AlignedAllocator< Type, BaseAllocator, Alignment > &  )
defaultnoexcept

copy-constructor

◆ AlignedAllocator() [3/3]

AlignedAllocator ( const AlignedAllocator< OtherType > &  other)
inlinenoexcept

copy-constructor from a rebound allocator

Definition at line 75 of file aligned_allocator.hpp.

Member Function Documentation

◆ allocate()

pointer allocate ( size_type  n,
const void *  = nullptr 
)
inline

Attempts to allocate a block of storage with a size large enough to contain n elements of member type value_type, and returns a pointer to the first element.

Definition at line 84 of file aligned_allocator.hpp.

◆ allocate_bytes()

void * allocate_bytes ( size_t  size,
size_t  meta_info_size = 0 
)
inline

Definition at line 133 of file aligned_allocator.hpp.

◆ base()

const BaseAllocator& base ( ) const
inline

Definition at line 114 of file aligned_allocator.hpp.

◆ deallocate()

void deallocate ( pointer  p,
size_type  n 
)
inlinenoexcept

Releases a block of storage previously allocated with member allocate and not yet released.

Definition at line 93 of file aligned_allocator.hpp.

◆ deallocate_bytes()

void deallocate_bytes ( void *  ptr,
size_t  size,
size_t  meta_info_size = 0 
)
inlinenoexcept

Definition at line 192 of file aligned_allocator.hpp.

◆ operator!=()

bool operator!= ( const AlignedAllocator< Other > &  other) const
inlinenoexcept

Compare to another allocator of same type.

Definition at line 105 of file aligned_allocator.hpp.

◆ operator=()

AlignedAllocator& operator= ( const AlignedAllocator< Type, BaseAllocator, Alignment > &  )
defaultnoexcept

copy-assignment operator

◆ operator==()

bool operator== ( const AlignedAllocator< Other > &  other) const
inlinenoexcept

Compare to another allocator of same type.

Definition at line 99 of file aligned_allocator.hpp.

Member Data Documentation

◆ base_

BaseAllocator base_
private

base allocator

Definition at line 118 of file aligned_allocator.hpp.

◆ debug

constexpr bool debug = false
staticprivate

Definition at line 45 of file aligned_allocator.hpp.


The documentation for this class was generated from the following file: