![]() |
Lumiera 0.pre.04
»edit your freedom«
|
#include "lib/branch-case.hpp"
A Sum Type to hold alternative results from a branched evaluation.
| TYPES | sequence of all the types corresponding to all branches |
Definition at line 122 of file branch-case.hpp.
Public Types | |
| template<size_t idx> | |
| using | SlotType = std::tuple_element_t< idx, tuple< TYPES... > > |
Static Public Attributes | |
| static constexpr auto | TOP = sizeof...(TYPES) -1 |
| static constexpr auto | SIZ = _MaxBuf<TYPES...>::siz |
Public Member Functions | |
| template<class FUN > | |
| auto | accept (FUN &&visitor) |
| Accept a visitor-functor (double dispatch). | |
| ~BranchCase () | |
| template<typename... INITS> | |
| BranchCase (size_t idx, INITS &&...inits) | |
| Standard constructor: select branch and provide initialiser. | |
| BranchCase (BranchCase const &o) | |
| BranchCase (BranchCase &&ro) | |
| BranchCase & | operator= (BranchCase ref) |
| size_t | selected () const |
| template<size_t idx> | |
| SlotType< idx > & | get () |
| re-access the value, using compile-time slot-index param. | |
| auto | getAny () |
| access the selected value of a homogeneous model. | |
Friends | |
| void | swap (BranchCase &o1, BranchCase &o2) |
Protected Member Functions | |
| BranchCase ()=default | |
| template<typename TX , typename... INITS> | |
| TX & | emplace (INITS &&...inits) |
| template<typename TX > | |
| TX & | access () |
| template<size_t idx, class FUN > | |
| auto | selectBranch (FUN &&fun) |
| apply generic functor to the currently selected branch | |
Protected Attributes | |
| size_t | branch_ {0} |
| selector field to designate the chosen branch | |
| std::byte | buffer_ [SIZ] |
| opaque inline storage buffer with suitable size and alignment | |
|
protecteddefault |
default-created state is invalid
|
inline |
Definition at line 183 of file branch-case.hpp.
References BranchCase< TYPES >::accept().
Here is the call graph for this function:
|
inline |
Standard constructor: select branch and provide initialiser.
Definition at line 193 of file branch-case.hpp.
References BranchCase< TYPES >::accept().
Here is the call graph for this function:
|
inline |
Definition at line 203 of file branch-case.hpp.
References BranchCase< TYPES >::branch_.
|
inline |
Definition at line 213 of file branch-case.hpp.
References BranchCase< TYPES >::branch_.
| using SlotType = std::tuple_element_t<idx, tuple<TYPES...> > |
Definition at line 129 of file branch-case.hpp.
|
inlineprotected |
Definition at line 145 of file branch-case.hpp.
References BranchCase< TYPES >::buffer_.
|
inlineprotected |
Definition at line 152 of file branch-case.hpp.
References BranchCase< TYPES >::buffer_.
|
inlineprotected |
apply generic functor to the currently selected branch
Definition at line 160 of file branch-case.hpp.
References BranchCase< TYPES >::branch_, and BranchCase< TYPES >::selectBranch().
Referenced by BranchCase< TYPES >::selectBranch().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Accept a visitor-functor (double dispatch).
Definition at line 178 of file branch-case.hpp.
Referenced by BranchCase< TYPES >::BranchCase(), BranchCase< TYPES >::~BranchCase(), and BranchCase< TYPES >::getAny().
Here is the caller graph for this function:
|
inline |
Definition at line 244 of file branch-case.hpp.
References BranchCase< TYPES >::swap.
|
inline |
Definition at line 252 of file branch-case.hpp.
References BranchCase< TYPES >::branch_.
re-access the value, using compile-time slot-index param.
Definition at line 262 of file branch-case.hpp.
Referenced by WrappedStandardExeBuilder::invokeOriginalBuilder().
Here is the caller graph for this function:
|
inline |
access the selected value of a homogeneous model.
Definition at line 271 of file branch-case.hpp.
References BranchCase< TYPES >::accept().
Here is the call graph for this function:
|
staticconstexpr |
Definition at line 125 of file branch-case.hpp.
|
staticconstexpr |
Definition at line 126 of file branch-case.hpp.
|
protected |
selector field to designate the chosen branch
Definition at line 135 of file branch-case.hpp.
Referenced by BranchCase< TYPES >::BranchCase(), BranchCase< TYPES >::BranchCase(), BranchCase< TYPES >::selectBranch(), and BranchCase< TYPES >::selected().
|
protected |
opaque inline storage buffer with suitable size and alignment
Definition at line 140 of file branch-case.hpp.
Referenced by BranchCase< TYPES >::access(), and BranchCase< TYPES >::emplace().
|
friend |
Definition at line 223 of file branch-case.hpp.
Referenced by BranchCase< TYPES >::operator=().
Inheritance diagram for BranchCase< TYPES >:
Collaboration diagram for BranchCase< TYPES >: