Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
Holder< TYPES > Struct Template Reference

#include "lib/variant-o.hpp"

Description

template<typename TYPES>
struct lib::variant::Holder< TYPES >

internal helper used to build a variant storage wrapper.

Parametrised with a collection of types, it provides functionality to copy a value of one of these types into an internal buffer, while remembering which of these types was used to place this copy. The value can be later on extracted using a visitation like mechanism, which takes a functor class and invokes a function access(T&) with the type matching the current value in storage

Definition at line 71 of file variant-o.hpp.

Classes

struct  Buffer
 Storage to hold the actual value. More...
 
struct  CasePrepare
 initialise the dispatcher (trampoline) for the case of accessing type T More...
 
struct  CaseSelect
 provide a dispatcher table based visitation mechanism More...
 
struct  Deleter
 
struct  PlacementAdapter
 

Public Types

enum  {
  TYPECNT = count<TYPES>::value ,
  SIZE = maxSize<TYPES>::value
}
 
typedef InstantiateWithIndex< TYPES, PlacementAdapter, BufferStorage
 

Static Public Member Functions

template<class FUNCTOR >
static FUNCTOR::Ret access (Buffer &buf)
 access the variant's inline buffer, using the configured access functor.
 

Member Typedef Documentation

◆ Storage

template<typename TYPES >
typedef InstantiateWithIndex< TYPES , PlacementAdapter , Buffer > Storage

Definition at line 118 of file variant-o.hpp.

Member Enumeration Documentation

◆ anonymous enum

template<typename TYPES >
anonymous enum
Enumerator
TYPECNT 
SIZE 

Definition at line 74 of file variant-o.hpp.

Member Function Documentation

◆ access()

template<typename TYPES >
template<class FUNCTOR >
static FUNCTOR::Ret access ( Buffer buf)
inlinestatic

access the variant's inline buffer, using the configured access functor.

Note
the actual accessor instance is created on demand (static)
Todo:
shouldn't this rather be located within the Holder::Storage created by clients??

Definition at line 181 of file variant-o.hpp.

References Holder< TYPES >::CaseSelect< FUNCTOR >::invoke().

Referenced by Holder< TYPES >::CaseSelect< FUNCTOR >::invoke().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:
+ Collaboration diagram for Holder< TYPES >:

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