31#ifndef CONTROL_COMMAND_IMPL_H
32#define CONTROL_COMMAND_IMPL_H
49 using std::shared_ptr;
79 template<
typename ARG>
90#define _TY(_ID_) typename _Type<ARG>::_ID_
98 template<
typename ARG>
158 pClo_->accept(visitor);
179 pClo_->unbindArguments();
230 operator string()
const
232 return _Fmt(
"Cmd|valid:%s, exec:%s, undo:%s |%s")
236 % (
pClo_? string(*
pClo_) : util::FAILURE_INDICATOR);
Token or Atom with distinct identity.
object-like record of data.
Visitor to support creating a CommandImpl clone.
Steam-Layer Command implementation.
function< SIG_cap > Func_cap
void prepareClone(CommandImplCloneBuilder &visitor) const
assist with building a clone copy of this CommandImpl.
CommandImpl(CommandImpl const &orig, UndoMutation const &newUndo, shared_ptr< CmdClosure > const &newClosure)
bool isValid() const
< validity self-check: is basically usable.
void setArguments(lib::diff::Rec const ¶mData)
shared_ptr< CmdClosure > pClo_
PattID getDefaultHandlingPattern() const
CommandImpl(shared_ptr< ARG > pStorageHolder, _TY(Func_op) const &operFunctor, _TY(Func_cap) const &captFunctor, _TY(Func_undo) const &undoFunctor)
build a new implementation frame, and do the initial wiring.
HandlingPattern::ID defaultPatt_
bool canUndo() const
< state check: has undo state been captured?
function< SIG_undo > Func_undo
function< SIG_op > Func_op
HandlingPattern::ID PattID
Symbol cmdID
human-readable marker for diagnostics, will be (re)assigned when activating this CommandImpl
bool canExec() const
< state check: sufficiently defined to be invoked
PattID setHandlingPattern(PattID newID)
define a handling pattern to be used by default
void setArguments(Arguments &args)
Interface: Operation Skeleton how to invoke or undo a command.
virtual bool isValid() const =0
static HandlingPattern const & get(ID id)
retrieve the pre-configured pattern
Unspecific command functor for implementing Steam-Layer Command.
Specialised version of the command Mutation functor, used to implement the UNDO functionality.
Mutation & captureState(CmdClosure &clo)
Any copy and copy construction prohibited.
A front-end for using printf-style formatting.
A closure enabling self-contained execution of commands within the SteamDispatcher.
Core of a Steam-Layer command: functor containing the operation to be executed.
Steam-Layer command frontend.
Steam-Layer implementation namespace root.
Mix-Ins to allow or prohibit various degrees of copying and cloning.