Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
StorageHolder< SIG, MEM > Class Template Reference

#include "steam/control/command-storage-holder.hpp"

Description

template<typename SIG, typename MEM>
class steam::control::StorageHolder< SIG, MEM >

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 71 of file command-storage-holder.hpp.

Public Types

using SIG_op = CommandSignature< SIG, MEM >::OperateSig
 
using SIG_cap = CommandSignature< SIG, MEM >::CaptureSig
 
using SIG_undo = CommandSignature< SIG, MEM >::UndoOp_Sig
 

Public Member Functions

virtual bool isValid () const override
 does this closure hold a valid argument tuple?
 
virtual bool isCaptured () const override
 does this closure hold captured UNDO state?
 
virtual void bindArguments (Arguments &args) override
 assign a new parameter tuple to this
 
virtual void bindArguments (lib::diff::Rec const &paramData) override
 assign a new set of parameter values to this.
 
virtual void unbindArguments () override
 discard any argument data and return to empty state
 
virtual void invoke (CmdFunctor const &func) override
 invoke functor using the stored parameter values
 
virtual operator string () const override
 
 StorageHolder ()
 per default, all data within StorageHolder is set up in empty state.
 
 StorageHolder (StorageHolder const &oAh)
 copy construction allowed(but no assignment).
 
StorageHolderoperator= (StorageHolder const &)=delete
 copy construction allowed(but no assignment)
 
void accept (CommandImplCloneBuilder &visitor) const override
 assist with creating a clone copy; this results in invocation of the copy ctor
 
bool canUndo () const
 has undo state capturing been invoked?
 
bool empty () const
 
void storeTuple (ArgTuple const &argTup)
 store a new argument tuple within this StorageHolder, discarding any previously stored arguments
 
void clearStorage ()
 
MementoTie< SIG, MEM > & tie (function< SIG_undo > const &undoFunc, function< SIG_cap > const &captureFunc)
 create a new memento storage wiring, discarding existing memento state.
 
MementoTie< SIG, MEM > & getMementoWiring ()
 just re-access an existing memento storage wiring.
 
MEMmemento ()
 direct "backdoor" access to stored memento value.
 
- Public Member Functions inherited from CmdClosure
virtual ~CmdClosure ()
 
 operator bool () const
 

Private Types

using ArgHolder = OpClosure< SIG >
 
using MemHolder = MementoTie< SIG, MEM >
 
using ArgumentBuff = InPlaceBuffer< ArgHolder >
 
using MementoBuff = InPlaceBuffer< MemHolder >
 
using ArgTuple = ArgHolder::ArgTuple
 
using Args = lib::meta::RebindTupleTypes< ArgTuple >::Seq
 

Private Attributes

ArgumentBuff arguments_
 
MementoBuff memento_
 

Constructor & Destructor Documentation

◆ StorageHolder() [1/2]

template<typename SIG , typename MEM >
StorageHolder ( )
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 162 of file command-storage-holder.hpp.

◆ StorageHolder() [2/2]

template<typename SIG , typename MEM >
StorageHolder ( StorageHolder< SIG, MEM > const oAh)
inline

copy construction allowed(but no assignment).

Remarks
rationale is to support immutable argument values, which means default/copy construction is OK

Definition at line 171 of file command-storage-holder.hpp.

References StorageHolder< SIG, MEM >::arguments_, and StorageHolder< SIG, MEM >::memento_.

Member Typedef Documentation

◆ ArgHolder

template<typename SIG , typename MEM >
using ArgHolder = OpClosure<SIG>
private

Definition at line 74 of file command-storage-holder.hpp.

◆ MemHolder

Definition at line 75 of file command-storage-holder.hpp.

◆ ArgumentBuff

Definition at line 77 of file command-storage-holder.hpp.

◆ MementoBuff

Definition at line 78 of file command-storage-holder.hpp.

◆ ArgTuple

template<typename SIG , typename MEM >
using ArgTuple = ArgHolder::ArgTuple
private

Definition at line 80 of file command-storage-holder.hpp.

◆ Args

Definition at line 81 of file command-storage-holder.hpp.

◆ SIG_op

template<typename SIG , typename MEM >
using SIG_op = CommandSignature<SIG,MEM>::OperateSig

Definition at line 218 of file command-storage-holder.hpp.

◆ SIG_cap

template<typename SIG , typename MEM >
using SIG_cap = CommandSignature<SIG,MEM>::CaptureSig

Definition at line 219 of file command-storage-holder.hpp.

◆ SIG_undo

template<typename SIG , typename MEM >
using SIG_undo = CommandSignature<SIG,MEM>::UndoOp_Sig

Definition at line 220 of file command-storage-holder.hpp.

Member Function Documentation

◆ isValid()

template<typename SIG , typename MEM >
virtual bool isValid ( ) const
inlineoverridevirtual

does this closure hold a valid argument tuple?

Implements CmdClosure.

Definition at line 95 of file command-storage-holder.hpp.

References StorageHolder< SIG, MEM >::arguments_.

Referenced by StorageHolder< SIG, MEM >::invoke().

+ Here is the caller graph for this function:

◆ isCaptured()

template<typename SIG , typename MEM >
virtual bool isCaptured ( ) const
inlineoverridevirtual

does this closure hold captured UNDO state?

Implements CmdClosure.

Definition at line 101 of file command-storage-holder.hpp.

References StorageHolder< SIG, MEM >::memento_.

◆ bindArguments() [1/2]

template<typename SIG , typename MEM >
virtual void bindArguments ( Arguments args)
inlineoverridevirtual

assign a new parameter tuple to this

Implements CmdClosure.

Definition at line 110 of file command-storage-holder.hpp.

References StorageHolder< SIG, MEM >::storeTuple().

+ Here is the call graph for this function:

◆ bindArguments() [2/2]

template<typename SIG , typename MEM >
virtual void bindArguments ( lib::diff::Rec const paramData)
inlineoverridevirtual

assign a new set of parameter values to this.

Note
the values are passed packaged into a sequence of GenNode elements. This is the usual way arguments are passed from the UI-Bus

Implements CmdClosure.

Definition at line 121 of file command-storage-holder.hpp.

References StorageHolder< SIG, MEM >::storeTuple().

+ Here is the call graph for this function:

◆ unbindArguments()

template<typename SIG , typename MEM >
virtual void unbindArguments ( )
inlineoverridevirtual

discard any argument data and return to empty state

Implements CmdClosure.

Definition at line 128 of file command-storage-holder.hpp.

References StorageHolder< SIG, MEM >::clearStorage().

+ Here is the call graph for this function:

◆ invoke()

template<typename SIG , typename MEM >
virtual void invoke ( CmdFunctor const )
inlineoverridevirtual

invoke functor using the stored parameter values

Implements CmdClosure.

Definition at line 135 of file command-storage-holder.hpp.

References StorageHolder< SIG, MEM >::arguments_, StorageHolder< SIG, MEM >::isValid(), and LERR_.

+ Here is the call graph for this function:

◆ operator string()

template<typename SIG , typename MEM >
virtual operator string ( ) const
inlineoverridevirtual

◆ operator=()

template<typename SIG , typename MEM >
StorageHolder & operator= ( StorageHolder< SIG, MEM > const )
delete

copy construction allowed(but no assignment)

◆ accept()

template<typename SIG , typename MEM >
void accept ( CommandImplCloneBuilder visitor) const
inlineoverridevirtual

assist with creating a clone copy; this results in invocation of the copy ctor

Implements CmdClosure.

Definition at line 191 of file command-storage-holder.hpp.

References CommandImplCloneBuilder::buildCloneContext().

+ Here is the call graph for this function:

◆ canUndo()

template<typename SIG , typename MEM >
bool canUndo ( ) const
inline

has undo state capturing been invoked?

Definition at line 198 of file command-storage-holder.hpp.

References StorageHolder< SIG, MEM >::memento_.

◆ empty()

template<typename SIG , typename MEM >
bool empty ( ) const
inline

Definition at line 199 of file command-storage-holder.hpp.

References StorageHolder< SIG, MEM >::arguments_.

◆ storeTuple()

template<typename SIG , typename MEM >
void storeTuple ( ArgTuple const argTup)
inline

store a new argument tuple within this StorageHolder, discarding any previously stored arguments

Definition at line 205 of file command-storage-holder.hpp.

References StorageHolder< SIG, MEM >::arguments_.

Referenced by StorageHolder< SIG, MEM >::bindArguments(), and StorageHolder< SIG, MEM >::bindArguments().

+ Here is the caller graph for this function:

◆ clearStorage()

template<typename SIG , typename MEM >
void clearStorage ( )
inline

Definition at line 211 of file command-storage-holder.hpp.

References StorageHolder< SIG, MEM >::arguments_, and StorageHolder< SIG, MEM >::memento_.

Referenced by StorageHolder< SIG, MEM >::unbindArguments().

+ Here is the caller graph for this function:

◆ tie()

template<typename SIG , typename MEM >
MementoTie< SIG, MEM > & tie ( function< SIG_undo > const undoFunc,
function< SIG_cap > const captureFunc 
)
inline

create a new memento storage wiring, discarding existing memento state.

Note
any bound undo/capture functions based on the previously held MementoTie are silently invalidated; using them will likely cause memory corruption!

Definition at line 226 of file command-storage-holder.hpp.

References StorageHolder< SIG, MEM >::memento_.

◆ getMementoWiring()

template<typename SIG , typename MEM >
MementoTie< SIG, MEM > & getMementoWiring ( )
inline

just re-access an existing memento storage wiring.

Used when cloning the closure

Definition at line 235 of file command-storage-holder.hpp.

References StorageHolder< SIG, MEM >::memento_.

◆ memento()

template<typename SIG , typename MEM >
MEM & memento ( )
inline

direct "backdoor" access to stored memento value.

Exceptions
LUMIERA_ERROR_MISSING_MEMENTOwhen invoked prior to tie(..) and capturing any state

Definition at line 246 of file command-storage-holder.hpp.

References StorageHolder< SIG, MEM >::memento_.

Member Data Documentation

◆ arguments_

◆ memento_

+ Inheritance diagram for StorageHolder< SIG, MEM >:
+ Collaboration diagram for StorageHolder< SIG, MEM >:

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