Lumiera  0.pre.03
»edit your freedom«
ElementFactory< I, ALO > Class Template Reference

#include "lib/several-builder.hpp"

Description

template<class I, template< typename > class ALO>
class lib::allo::ElementFactory< I, ALO >

Generic factory to manage objects within an ArrayBucket storage, delegating to a custom allocator ALO for memory handling.

  • #create a storage block for a number of objects
  • #createAt construct a single payload object at index position
  • #destroy a storage block with proper clean-up (invoke dtors)

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

Public Member Functions

 ElementFactory (Allo allo=Allo{})
 
template<typename X >
 ElementFactory (ElementFactory< X, ALO > &relatedFac)
 allow cross-initialisation when using same kind of base allocator
 
Bucket * create (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)
 

Friends

template<typename O , template< typename > class XALO>
class ElementFactory
 

Private Types

using Allo = ALO< std::byte >
 
using AlloT = std::allocator_traits< Allo >
 
using Bucket = ArrayBucket< I >
 

Private Member Functions

template<typename X >
auto adaptAllocator ()
 
Allo & baseAllocator ()
 
+ Inheritance diagram for ElementFactory< I, ALO >:
+ Collaboration diagram for ElementFactory< I, ALO >:

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