Lumiera  0.pre.03
»edit your freedom«
command-signature.hpp File Reference

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>

Classes

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...
 
class  CommandSignature< SIG, MEM >
 Metaprogramming helper for building Command function signatures. More...
 
class  UndoSignature< SIG >
 Type analysis helper template. 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.
 

Namespaces

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

Class Documentation

◆ steam::control::UndoSignature::Case

struct steam::control::UndoSignature::Case
Class Members
typedef RET Memento
typedef typename Append< ARG,
Memento >::List
ExtendedArglist
typedef typename Types
< ExtendedArglist >::Seq
ExtendedArgs
typedef typename BuildFunType
< void, ARG >::Sig
OperateSig
typedef typename BuildFunType
< Ret, ARG >::Sig
CaptureSig
typedef typename BuildFunType
< void, ExtendedArgs >::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 typename List Args
typedef typename SplitLast
< Args >::Type
Memento
typedef typename SplitLast
< Args >::List
OperationArglist
typedef typename Types
< OperationArglist >::Seq
OperationArgs
typedef typename BuildFunType
< void, OperationArgs >::Sig
OperateSig
typedef typename BuildFunType
< Ret, OperationArgs >::Sig
CaptureSig
typedef typename BuildFunType
< void, ARG >::Sig
UndoOp_Sig
+ Collaboration diagram for UndoSignature< SIG >::Case< void, ARG >: