Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
command-signature.hpp File Reference

Metaprogramming helpers for deriving the precise function signatures necessary to implement a given command. More...

Go to the source code of this file.

Description

Metaprogramming helpers for deriving the precise function signatures necessary to implement a given command.

Basically, commands can be implemented by arbitrary functions, but the signatures of the operation function, the undo function and the undo state capturing function are required to obey fixed relationships. Thus, at various stages of the command definition, we need to accept functor objects with a very specific and predetermined signature, thus allowing for strict type checking by the compiler.

Relation of function signatures (MEM = type of the "memento" for Undo)
  • operation: void(P1,..PN)
  • captureUndo: MEM(P1,..PN)
  • undoOperation void(P1,..PN,MEM)
  • bind takes the arguments:(P1,..PN)
See also
Command
CommandDef

Definition in file command-signature.hpp.

#include "lib/meta/function.hpp"
#include "lib/meta/typelist.hpp"
#include "lib/meta/typelist-manip.hpp"
#include "lib/meta/typeseq-util.hpp"
#include <functional>

Namespaces

namespace  lumiera
 Lumiera public interface.
 
namespace  lumiera::error
 
namespace  steam
 Steam-Layer implementation namespace root.
 
namespace  steam::control
 Steam-Layer dispatcher, controller and administrative facilities.
 

Classes

class  CommandSignature< SIG, MEM >
 Metaprogramming helper for building Command function signatures. More...
 
class  UndoSignature< SIG >
 Type analysis helper template. More...
 
struct  UndoSignature< SIG >::Case< RET, ARG >
 Case1: defining the Undo-Capture function. More...
 
struct  UndoSignature< SIG >::Case< void, ARG >
 Case2: defining the actual Undo function. More...
 

Functions

 LUMIERA_ERROR_DECLARE (UNBOUND_ARGUMENTS)
 Command functor not yet usable, because arguments aren't bound.
 
 LUMIERA_ERROR_DECLARE (MISSING_MEMENTO)
 Undo functor not yet usable, because no undo state has been captured.
 

Class Documentation

◆ steam::control::UndoSignature::Case

struct steam::control::UndoSignature::Case
Class Members
typedef RET Memento
typedef List ExtendedArglist
typedef Seq ExtendedArgs
typedef Sig OperateSig
typedef Sig CaptureSig
typedef Sig UndoOp_Sig
+ Collaboration diagram for UndoSignature< SIG >::Case< RET, ARG >:

◆ steam::control::UndoSignature::Case< void, ARG >

struct steam::control::UndoSignature::Case< void, ARG >
Class Members
typedef List Args
typedef Type Memento
typedef List OperationArglist
typedef Seq OperationArgs
typedef Sig OperateSig
typedef Sig CaptureSig
typedef Sig UndoOp_Sig
+ Collaboration diagram for UndoSignature< SIG >::Case< void, ARG >: