ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::MappableAllocator< T, V > Class Template Reference

std::allocator, which also makes a vector over the bytes of a mapped file [see restoreMapped()]; an item constructed with no argument is value-initialized if \( V \), else left uninitialized (the numbers about to be written of a matrix) More...

#include <ADS/external/MappedFile.h>

Classes

struct  rebind
 the same allocator, of items of the type U More...

Public types

using value_type = T
 the type of an item
using adopts_mapping = void
 a vector on it may be a view of a mapped file
using propagate_on_container_move_assignment = std::true_type
 the mapping goes with the memory
using propagate_on_container_swap = std::true_type
 the mapping goes with the memory
using is_always_equal = std::false_type
 two allocators of different mappings differ

Public member functions

 MappableAllocator (void)=default
 an allocator of new memory only
 MappableAllocator (MappedFile m) noexcept
 an allocator that takes the bytes that \( m \) offers
template<class U>
 MappableAllocator (const MappableAllocator< U, V > &o) noexcept
MappableAllocator select_on_container_copy_construction (void) const
 the allocator of a copy, of new memory only
T * allocate (std::size_t n)
void deallocate (T *p, std::size_t n) noexcept
template<class U, class... A>
void construct (U *p, A &&... a)
 an item constructed with no argument over the mapping is left as the file has it (an item of a mapped array is trivially copyable, and there by the bytes of the file), any other one as \( V \) asks

Friends

template<class U, bool W>
class MappableAllocator
bool operator== (const MappableAllocator &a, const MappableAllocator &b) noexcept
 whether the two hold the same mapping, or none

Detailed description

template<class T, bool V = true>
class ADS::MappableAllocator< T, V >

std::allocator, which also makes a vector over the bytes of a mapped file [see restoreMapped()]; an item constructed with no argument is value-initialized if \( V \), else left uninitialized (the numbers about to be written of a matrix)

Member typedef documentation

◆ adopts_mapping

template<class T, bool V = true>
using ADS::MappableAllocator< T, V >::adopts_mapping = void

a vector on it may be a view of a mapped file

◆ is_always_equal

template<class T, bool V = true>
using ADS::MappableAllocator< T, V >::is_always_equal = std::false_type

two allocators of different mappings differ

◆ propagate_on_container_move_assignment

template<class T, bool V = true>
using ADS::MappableAllocator< T, V >::propagate_on_container_move_assignment = std::true_type

the mapping goes with the memory

◆ propagate_on_container_swap

template<class T, bool V = true>
using ADS::MappableAllocator< T, V >::propagate_on_container_swap = std::true_type

the mapping goes with the memory

◆ value_type

template<class T, bool V = true>
using ADS::MappableAllocator< T, V >::value_type = T

the type of an item

Constructor and destructor documentation

◆ MappableAllocator() [1/3]

template<class T, bool V = true>
ADS::MappableAllocator< T, V >::MappableAllocator ( void )
default

an allocator of new memory only

◆ MappableAllocator() [2/3]

template<class T, bool V = true>
ADS::MappableAllocator< T, V >::MappableAllocator ( MappedFile m)
inlineexplicitnoexcept

an allocator that takes the bytes that \( m \) offers

◆ MappableAllocator() [3/3]

template<class T, bool V = true>
template<class U>
ADS::MappableAllocator< T, V >::MappableAllocator ( const MappableAllocator< U, V > & o)
inlinenoexcept

Member function documentation

◆ allocate()

template<class T, bool V = true>
T * ADS::MappableAllocator< T, V >::allocate ( std::size_t n)
inlinenodiscard

◆ construct()

template<class T, bool V = true>
template<class U, class... A>
void ADS::MappableAllocator< T, V >::construct ( U * p,
A &&... a )
inline

an item constructed with no argument over the mapping is left as the file has it (an item of a mapped array is trivially copyable, and there by the bytes of the file), any other one as \( V \) asks

◆ deallocate()

template<class T, bool V = true>
void ADS::MappableAllocator< T, V >::deallocate ( T * p,
std::size_t n )
inlinenoexcept

◆ select_on_container_copy_construction()

template<class T, bool V = true>
MappableAllocator ADS::MappableAllocator< T, V >::select_on_container_copy_construction ( void ) const
inlinenodiscard

the allocator of a copy, of new memory only

◆ MappableAllocator

template<class T, bool V = true>
template<class U, bool W>
friend class MappableAllocator
friend

◆ operator==

template<class T, bool V = true>
bool operator== ( const MappableAllocator< T, V > & a,
const MappableAllocator< T, V > & b )
friend

whether the two hold the same mapping, or none


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