![]() |
Lumiera 0.pre.04
»edit your freedom«
|
#include "lib/item-wrapper.hpp"
Universal value/ref wrapper accessible similar to a pointer.
A copyable, assignable value object to hold a given value within an embedded inline buffer. It can be default constructed and bool evaluated to detect an empty holder. The value is retrieved through a pointer-like interface, by explicit dereferentiation. (Contrast this to std::ref, where the original reference is retrieved by conversion).
The purpose of this template is to be able to remember pretty much any kind of value or pointer or reference, and to subsume this handling within a single template. An example would be to remember the value yielded by a function, without any further assumptions regarding this function.
Definition at line 78 of file item-wrapper.hpp.
Public Member Functions | |
| ItemWrapper () | |
| ItemWrapper (TY const &o) | |
| ItemWrapper (TY &&ro) | |
| ~ItemWrapper () | |
| ItemWrapper (ItemWrapper const &ref) | |
| ItemWrapper (ItemWrapper &&rref) | |
| ItemWrapper & | operator= (ItemWrapper const &cref) |
| ItemWrapper & | operator= (ItemWrapper &ref) |
| ItemWrapper & | operator= (ItemWrapper &&rref) |
| template<typename X > | |
| ItemWrapper & | operator= (X &&something) |
| Emulate »assignment« by discarding and then construction of a new payload. | |
| ItemWrapper & | defaultInit () |
| implant a default-initialised instance of the payload type | |
| operator bool () const | |
| TY & | operator* () const |
| TY * | operator-> () const |
| bool | isValid () const |
| void | reset () |
Private Types | |
| using | TY_unconst = std::remove_const_t< TY > |
Private Member Functions | |
| template<typename REF > | |
| void | build (REF &&ref) |
| void | discard () |
| TY & | access () const |
| TY_unconst & | access_unconst () const |
| < used to assign new buffer contents | |
Private Attributes | |
| std::byte | content_ [sizeof(TY)] |
| bool | created_ |
|
inline |
Definition at line 117 of file item-wrapper.hpp.
|
inlineexplicit |
Definition at line 122 of file item-wrapper.hpp.
References ItemWrapper< TY >::build().
Here is the call graph for this function:
|
inlineexplicit |
Definition at line 128 of file item-wrapper.hpp.
References ItemWrapper< TY >::build().
Here is the call graph for this function:
|
inline |
Definition at line 134 of file item-wrapper.hpp.
References ItemWrapper< TY >::discard().
Here is the call graph for this function:
|
inline |
Definition at line 142 of file item-wrapper.hpp.
References ItemWrapper< TY >::build(), and ItemWrapper< TY >::isValid().
Here is the call graph for this function:
|
inline |
Definition at line 148 of file item-wrapper.hpp.
References ItemWrapper< TY >::build().
Here is the call graph for this function:
|
private |
Definition at line 81 of file item-wrapper.hpp.
|
inlineprivate |
Definition at line 91 of file item-wrapper.hpp.
References ItemWrapper< TY >::content_, and ItemWrapper< TY >::created_.
Referenced by ItemWrapper< TY >::ItemWrapper(), ItemWrapper< TY >::ItemWrapper(), ItemWrapper< TY >::ItemWrapper(), ItemWrapper< TY >::ItemWrapper(), ItemWrapper< TY >::defaultInit(), and ItemWrapper< TY >::operator=().
Here is the caller graph for this function:
|
inlineprivate |
Definition at line 98 of file item-wrapper.hpp.
References ItemWrapper< TY >::access(), and ItemWrapper< TY >::created_.
Referenced by ItemWrapper< TY >::~ItemWrapper(), ItemWrapper< TY >::defaultInit(), ItemWrapper< TY >::operator=(), ItemWrapper< TY >::operator=(), ItemWrapper< TY >::operator=(), and ItemWrapper< TY >::reset().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprivate |
Definition at line 105 of file item-wrapper.hpp.
References ItemWrapper< TY >::content_.
Referenced by ItemWrapper< TY >::access_unconst(), ItemWrapper< TY >::discard(), ItemWrapper< TY >::operator*(), and ItemWrapper< TY >::operator=().
Here is the caller graph for this function:
|
inlineprivate |
< used to assign new buffer contents
Definition at line 111 of file item-wrapper.hpp.
References ItemWrapper< TY >::access().
Here is the call graph for this function:
|
inline |
Definition at line 159 of file item-wrapper.hpp.
References ItemWrapper< TY >::discard(), ItemWrapper< TY >::isValid(), and ItemWrapper< TY >::operator=().
Referenced by ItemWrapper< TY >::operator=(), and ItemWrapper< TY >::operator=().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 169 of file item-wrapper.hpp.
|
inline |
Definition at line 174 of file item-wrapper.hpp.
References ItemWrapper< TY >::discard(), and ItemWrapper< TY >::operator=().
Here is the call graph for this function:Emulate »assignment« by discarding and then construction of a new payload.
| something | from which TY can be (copy/move)constructed |
Definition at line 197 of file item-wrapper.hpp.
References ItemWrapper< TY >::access(), ItemWrapper< TY >::build(), and ItemWrapper< TY >::discard().
Here is the call graph for this function:
|
inline |
implant a default-initialised instance of the payload type
Definition at line 209 of file item-wrapper.hpp.
References ItemWrapper< TY >::build(), and ItemWrapper< TY >::discard().
Referenced by ActivityDetector::DiagnosticFun< RET, ARGS >::DiagnosticFun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 216 of file item-wrapper.hpp.
References ItemWrapper< TY >::isValid().
Here is the call graph for this function:
|
inline |
Definition at line 224 of file item-wrapper.hpp.
References ItemWrapper< TY >::access(), ItemWrapper< TY >::created_, and LERR_.
Here is the call graph for this function:
|
inline |
Definition at line 233 of file item-wrapper.hpp.
|
inline |
Definition at line 239 of file item-wrapper.hpp.
References ItemWrapper< TY >::created_.
Referenced by ItemWrapper< TY >::ItemWrapper(), SingleValCore< VAL >::evaluate(), FunctionResult< SIG >::isValid(), ItemWrapper< TY >::operator bool(), and ItemWrapper< TY >::operator=().
Here is the caller graph for this function:
|
inline |
Definition at line 245 of file item-wrapper.hpp.
References ItemWrapper< TY >::discard().
Referenced by SingleValCore< VAL >::advance(), MementoTie< SIG, MEM >::clear(), Transformer< SRC, RES >::expandChildren(), Transformer< SRC, RES >::iterNext(), TransformingCore< IT, VAL >::processItem(), and ItemWrapper_test::verifyWrapper().
Here is the call graph for this function:
Here is the caller graph for this function:
|
mutableprivate |
Definition at line 85 of file item-wrapper.hpp.
Referenced by ItemWrapper< TY >::access(), and ItemWrapper< TY >::build().
|
private |
Definition at line 87 of file item-wrapper.hpp.
Referenced by ItemWrapper< TY >::build(), ItemWrapper< TY >::discard(), ItemWrapper< TY >::isValid(), and ItemWrapper< TY >::operator*().
Inheritance diagram for ItemWrapper< TY >:
Collaboration diagram for ItemWrapper< TY >: