Lumiera
0.pre.03
»edit your freedom«
|
#include "steam/control/command-storage-holder.hpp"
This is "the" top level CmdClosure implementation.
It is a specifically typed CmdClosure, which serves for actually allocating storage to hold the command arguments and the UNDO state (memento) for Steam-Layer commands. Both the contained components within StorageHolder can be in empty state; there are no distinct lifecycle limitations. StorageHolder is part of Steam-Layer command's implementation and should not be used standalone.
Definition at line 80 of file command-storage-holder.hpp.
Public Types | |
typedef CommandSignature< SIG, MEM >::CaptureSig | SIG_cap |
typedef CommandSignature< SIG, MEM >::OperateSig | SIG_op |
typedef CommandSignature< SIG, MEM >::UndoOp_Sig | SIG_undo |
Public Member Functions | |
StorageHolder () | |
per default, all data within StorageHolder is set up in empty state. More... | |
StorageHolder (StorageHolder const &oAh) | |
copy construction allowed(but no assignment). More... | |
void | accept (CommandImplCloneBuilder &visitor) const override |
assist with creating a clone copy; this results in invocation of the copy ctor | |
virtual void | bindArguments (Arguments &args) override |
assign a new parameter tuple to this | |
virtual void | bindArguments (lib::diff::Rec const ¶mData) override |
assign a new set of parameter values to this. More... | |
bool | canUndo () const |
has undo state capturing been invoked? | |
void | clearStorage () |
bool | empty () const |
MementoTie< SIG, MEM > & | getMementoWiring () |
just re-access an existing memento storage wiring. More... | |
virtual void | invoke (CmdFunctor const &func) override |
invoke functor using the stored parameter values | |
virtual bool | isCaptured () const override |
does this closure hold captured UNDO state? | |
virtual bool | isValid () const override |
does this closure hold a valid argument tuple? | |
MEM & | memento () |
direct "backdoor" access to stored memento value. More... | |
virtual | operator string () const override |
StorageHolder & | operator= (StorageHolder const &)=delete |
copy construction allowed(but no assignment) | |
void | storeTuple (ArgTuple const &argTup) |
store a new argument tuple within this StorageHolder, discarding any previously stored arguments | |
MementoTie< SIG, MEM > & | tie (function< SIG_undo > const &undoFunc, function< SIG_cap > const &captureFunc) |
create a new memento storage wiring, discarding existing memento state. More... | |
virtual void | unbindArguments () override |
discard any argument data and return to empty state | |
Public Member Functions inherited from CmdClosure | |
operator bool () const | |
Private Types | |
using | ArgHolder = OpClosure< SIG > |
using | Args = typename lib::meta::RebindTupleTypes< ArgTuple >::Seq |
using | ArgTuple = typename ArgHolder::ArgTuple |
using | ArgumentBuff = InPlaceBuffer< ArgHolder > |
using | MementoBuff = InPlaceBuffer< MemHolder > |
using | MemHolder = MementoTie< SIG, MEM > |
Private Attributes | |
ArgumentBuff | arguments_ |
MementoBuff | memento_ |
|
inline |
per default, all data within StorageHolder is set up in empty state.
Later on, the command arguments are to be provided by #bind , whereas the undo functions will be wired by tie
Definition at line 171 of file command-storage-holder.hpp.
|
inline |
copy construction allowed(but no assignment).
Definition at line 180 of file command-storage-holder.hpp.
References StorageHolder< SIG, MEM >::operator=().
|
inlineoverridevirtual |
assign a new set of parameter values to this.
Implements CmdClosure.
Definition at line 130 of file command-storage-holder.hpp.
References StorageHolder< SIG, MEM >::storeTuple().
|
inline |
create a new memento storage wiring, discarding existing memento state.
Definition at line 235 of file command-storage-holder.hpp.
|
inline |
just re-access an existing memento storage wiring.
Used when cloning the closure
Definition at line 244 of file command-storage-holder.hpp.
|
inline |
direct "backdoor" access to stored memento value.
LUMIERA_ERROR_MISSING_MEMENTO | when invoked prior to tie (..) and capturing any state |
Definition at line 255 of file command-storage-holder.hpp.