Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
SimpleClosure< SIG > Class Template Reference

#include "steam/control/command-simple-closure.hpp"

Description

template<typename SIG>
class steam::control::SimpleClosure< SIG >

Dummy / proof-of-concept implementation of CmdClosure.

It is a specifically typed subclass, which serves to hold storage for the concrete invocation arguments within an inline buffer.

Note
for demonstration and unit testing
See also
StorageHolder real world implementation

Definition at line 68 of file command-simple-closure.hpp.

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
 
 SimpleClosure ()
 per default, all data within StorageHolder is set up in empty state.
 
 SimpleClosure (ArgTuple const &args)
 
 SimpleClosure (SimpleClosure const &oAh)
 
void accept (CommandImplCloneBuilder &) const override
 assist with creating clone closure without disclosing concrete type
 
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 ()
 
- Public Member Functions inherited from CmdClosure
virtual ~CmdClosure ()
 
 operator bool () const
 

Private Types

using ArgHolder = OpClosure< SIG >
 
using ArgumentBuff = InPlaceBuffer< ArgHolder >
 
using ArgTuple = ArgHolder::ArgTuple
 
using Args = lib::meta::RebindTupleTypes< ArgTuple >::Seq
 

Private Attributes

ArgumentBuff arguments_
 

Constructor & Destructor Documentation

◆ SimpleClosure() [1/3]

template<typename SIG >
SimpleClosure ( )
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 155 of file command-simple-closure.hpp.

◆ SimpleClosure() [2/3]

template<typename SIG >
SimpleClosure ( ArgTuple const args)
inlineexplicit

Definition at line 160 of file command-simple-closure.hpp.

References SimpleClosure< SIG >::storeTuple().

+ Here is the call graph for this function:

◆ SimpleClosure() [3/3]

template<typename SIG >
SimpleClosure ( SimpleClosure< SIG > const oAh)
inline

Definition at line 166 of file command-simple-closure.hpp.

References SimpleClosure< SIG >::arguments_.

Member Typedef Documentation

◆ ArgHolder

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

Definition at line 71 of file command-simple-closure.hpp.

◆ ArgumentBuff

Definition at line 72 of file command-simple-closure.hpp.

◆ ArgTuple

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

Definition at line 74 of file command-simple-closure.hpp.

◆ Args

Definition at line 75 of file command-simple-closure.hpp.

Member Function Documentation

◆ isValid()

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

does this closure hold a valid argument tuple?

Implements CmdClosure.

Definition at line 88 of file command-simple-closure.hpp.

References SimpleClosure< SIG >::arguments_.

Referenced by SimpleClosure< SIG >::invoke().

+ Here is the caller graph for this function:

◆ isCaptured()

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

does this closure hold captured UNDO state?

Implements CmdClosure.

Definition at line 94 of file command-simple-closure.hpp.

◆ bindArguments() [1/2]

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

assign a new parameter tuple to this

Implements CmdClosure.

Definition at line 103 of file command-simple-closure.hpp.

References SimpleClosure< SIG >::storeTuple().

+ Here is the call graph for this function:

◆ bindArguments() [2/2]

template<typename SIG >
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 114 of file command-simple-closure.hpp.

References SimpleClosure< SIG >::storeTuple().

+ Here is the call graph for this function:

◆ unbindArguments()

template<typename SIG >
virtual void unbindArguments ( )
inlineoverridevirtual

discard any argument data and return to empty state

Implements CmdClosure.

Definition at line 121 of file command-simple-closure.hpp.

References SimpleClosure< SIG >::clearStorage().

+ Here is the call graph for this function:

◆ invoke()

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

invoke functor using the stored parameter values

Implements CmdClosure.

Definition at line 128 of file command-simple-closure.hpp.

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

+ Here is the call graph for this function:

◆ operator string()

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

Implements CmdClosure.

Definition at line 140 of file command-simple-closure.hpp.

References SimpleClosure< SIG >::arguments_.

◆ accept()

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

assist with creating clone closure without disclosing concrete type

Implements CmdClosure.

Definition at line 175 of file command-simple-closure.hpp.

◆ canUndo()

template<typename SIG >
bool canUndo ( ) const
inline

has undo state capturing been invoked?

Definition at line 182 of file command-simple-closure.hpp.

◆ empty()

template<typename SIG >
bool empty ( ) const
inline

Definition at line 183 of file command-simple-closure.hpp.

References SimpleClosure< SIG >::arguments_.

◆ storeTuple()

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

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

Definition at line 189 of file command-simple-closure.hpp.

References SimpleClosure< SIG >::arguments_.

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

+ Here is the caller graph for this function:

◆ clearStorage()

template<typename SIG >
void clearStorage ( )
inline

Definition at line 195 of file command-simple-closure.hpp.

References SimpleClosure< SIG >::arguments_.

Referenced by SimpleClosure< SIG >::unbindArguments().

+ Here is the caller graph for this function:

Member Data Documentation

◆ arguments_

+ Inheritance diagram for SimpleClosure< SIG >:
+ Collaboration diagram for SimpleClosure< SIG >:

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