Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
AllocationPolicy< I, E, ALO > Struct Template Reference

#include "lib/several-builder.hpp"

Description

template<class I, class E, template< typename > class ALO>
struct lib::allo::AllocationPolicy< I, E, ALO >

Policy Mix-In used to adapt to the ElementFactory and Allocator.

Template Parameters
IInterface type (also used in the lib::Several<I> front-end
Ea common element type to use by default
ALOcustom allocator template

Definition at line 299 of file several-builder.hpp.

Public Types

using Fac = ElementFactory< I, ALO >
 
using Bucket = ArrayBucket< I >
 

Static Public Attributes

static size_t constexpr ALLOC_LIMIT = size_t(-1) / sizeof(E)
 by default assume that memory is practically unlimited...
 

Public Member Functions

bool canExpand (Bucket *, size_t)
 Extension point: able to adjust dynamically to the requested size?
 
Bucketrealloc (Bucket *data, size_t cnt, size_t spread)
 
void moveElem (size_t idx, Bucket *src, Bucket *tar)
 
- Public Member Functions inherited from ElementFactory< I, ALO >
 ElementFactory (Allo allo=Allo{})
 
template<typename X >
 ElementFactory (ElementFactory< X, ALO > &relatedFac)
 allow cross-initialisation when using same kind of base allocator
 
Bucketcreate (size_t cnt, size_t spread, size_t alignment=alignof(I))
 
template<class E , typename... ARGS>
E & createAt (Bucket *bucket, size_t idx, ARGS &&...args)
 
template<class E >
void destroy (ArrayBucket< I > *bucket)
 

Member Typedef Documentation

◆ Fac

template<class I , class E , template< typename > class ALO>
using Fac = ElementFactory<I, ALO>

Definition at line 302 of file several-builder.hpp.

◆ Bucket

template<class I , class E , template< typename > class ALO>
using Bucket = ArrayBucket<I>

Definition at line 303 of file several-builder.hpp.

Member Function Documentation

◆ canExpand()

template<class I , class E , template< typename > class ALO>
bool canExpand ( Bucket ,
size_t   
)
inline

Extension point: able to adjust dynamically to the requested size?

Definition at line 311 of file several-builder.hpp.

◆ realloc()

template<class I , class E , template< typename > class ALO>
Bucket * realloc ( Bucket data,
size_t  cnt,
size_t  spread 
)
inline

Definition at line 314 of file several-builder.hpp.

References ElementFactory< I, ALO >::create(), and AllocationPolicy< I, E, ALO >::moveElem().

+ Here is the call graph for this function:

◆ moveElem()

template<class I , class E , template< typename > class ALO>
void moveElem ( size_t  idx,
Bucket src,
Bucket tar 
)
inline

Definition at line 331 of file several-builder.hpp.

Referenced by AllocationPolicy< I, E, ALO >::realloc().

+ Here is the caller graph for this function:

Member Data Documentation

◆ ALLOC_LIMIT

template<class I , class E , template< typename > class ALO>
size_t constexpr ALLOC_LIMIT = size_t(-1) / sizeof(E)
staticconstexpr

by default assume that memory is practically unlimited...

Definition at line 308 of file several-builder.hpp.

+ Inheritance diagram for AllocationPolicy< I, E, ALO >:
+ Collaboration diagram for AllocationPolicy< I, E, ALO >:

The documentation for this struct was generated from the following files: