Thrill  0.1
FixedPoolAllocator< Type, pool_ > Class Template Reference

Detailed Description

template<typename Type, Pool &(*)() pool_>
class thrill::mem::FixedPoolAllocator< Type, pool_ >

Definition at line 266 of file pool.hpp.

+ Inheritance diagram for FixedPoolAllocator< Type, pool_ >:
+ Collaboration diagram for FixedPoolAllocator< Type, pool_ >:

#include <pool.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::true_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

 FixedPoolAllocator () noexcept=default
 construct FixedPoolAllocator with Pool object More...
 
 FixedPoolAllocator (const FixedPoolAllocator &) noexcept=default
 copy-constructor More...
 
template<typename OtherType >
 FixedPoolAllocator (const FixedPoolAllocator< OtherType, pool_ > &) noexcept
 copy-constructor from a rebound allocator More...
 
pointer allocate (size_type n, const void *=nullptr)
 
void deallocate (pointer p, size_type n) const noexcept
 
size_type max_size () const noexcept
 maximum size possible to allocate More...
 
template<typename Other >
bool operator!= (const FixedPoolAllocator< Other, pool_ > &) const noexcept
 compare to another allocator of same type More...
 
FixedPoolAllocatoroperator= (const FixedPoolAllocator &) noexcept=default
 copy-assignment operator More...
 
template<typename Other >
bool operator== (const FixedPoolAllocator< Other, pool_ > &) 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...
 

Member Typedef Documentation

◆ const_pointer

using const_pointer = const Type *

Definition at line 271 of file pool.hpp.

◆ const_reference

using const_reference = const Type&

Definition at line 273 of file pool.hpp.

◆ difference_type

using difference_type = std::ptrdiff_t

Definition at line 275 of file pool.hpp.

◆ is_always_equal

using is_always_equal = std::true_type

C++11 type flag.

Definition at line 278 of file pool.hpp.

◆ pointer

using pointer = Type *

Definition at line 270 of file pool.hpp.

◆ reference

using reference = Type&

Definition at line 272 of file pool.hpp.

◆ size_type

using size_type = std::size_t

Definition at line 274 of file pool.hpp.

◆ value_type

using value_type = Type

Definition at line 269 of file pool.hpp.

Constructor & Destructor Documentation

◆ FixedPoolAllocator() [1/3]

FixedPoolAllocator ( )
defaultnoexcept

construct FixedPoolAllocator with Pool object

◆ FixedPoolAllocator() [2/3]

FixedPoolAllocator ( const FixedPoolAllocator< Type, pool_ > &  )
defaultnoexcept

copy-constructor

◆ FixedPoolAllocator() [3/3]

FixedPoolAllocator ( const FixedPoolAllocator< OtherType, pool_ > &  )
inlinenoexcept

copy-constructor from a rebound allocator

Definition at line 292 of file pool.hpp.

References Pool::operator=().

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 305 of file pool.hpp.

◆ deallocate()

void deallocate ( pointer  p,
size_type  n 
) const
inlinenoexcept

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

Definition at line 311 of file pool.hpp.

References FixedPoolAllocator< Type, pool_ >::deallocate().

Referenced by FixedPoolAllocator< Type, pool_ >::deallocate().

◆ max_size()

size_type max_size ( ) const
inlinenoexcept

maximum size possible to allocate

Definition at line 298 of file pool.hpp.

References FixedPoolAllocator< Type, pool_ >::max_size().

Referenced by FixedPoolAllocator< Type, pool_ >::max_size().

◆ operator!=()

bool operator!= ( const FixedPoolAllocator< Other, pool_ > &  ) const
inlinenoexcept

compare to another allocator of same type

Definition at line 323 of file pool.hpp.

◆ operator=()

FixedPoolAllocator& operator= ( const FixedPoolAllocator< Type, pool_ > &  )
defaultnoexcept

copy-assignment operator

◆ operator==()

bool operator== ( const FixedPoolAllocator< Other, pool_ > &  ) const
inlinenoexcept

compare to another allocator of same type

Definition at line 317 of file pool.hpp.


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