Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
command-closure.hpp
Go to the documentation of this file.
1/*
2 COMMAND-CLOSURE.hpp - defining execution targets and parameters for commands
3
4 Copyright (C)
5 2009, Hermann Vosseler <Ichthyostega@web.de>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12*/
13
14
59#ifndef CONTROL_COMMAND_CLOSURE_H
60#define CONTROL_COMMAND_CLOSURE_H
61
64#include "lib/diff/gen-node.hpp"
65
66#include <memory>
67#include <string>
68
69
70namespace steam {
71namespace control {
72
75
76 using std::string;
77
78
79
85
87
88
89
90
93 {
94 public:
95 virtual ~CmdClosure() {}
96 explicit operator bool() const { return isValid(); }
97
98 virtual operator string() const =0;
99 virtual bool isValid () const =0;
100 virtual bool isCaptured () const =0;
101 virtual void bindArguments (Arguments&) =0;
102 virtual void bindArguments (lib::diff::Rec const&) =0;
103 virtual void unbindArguments() =0;
104 virtual void invoke (CmdFunctor const&) =0;
105 virtual void accept (CommandImplCloneBuilder&) const =0;
106 };
107
108
109 using PClo = std::shared_ptr<CmdClosure>;
110
111
112
113}} // namespace steam::control
114#endif /*CONTROL_COMMAND_CLOSURE_H*/
Implementation helper to bind Steam-Layer commands with arbitrary argument tuples.
object-like record of data.
Definition record.hpp:142
Policy for FunErasure: store an embedded std::function Using this policy allows to store arbitrary co...
virtual bool isCaptured() const =0
does this closure hold captured UNDO state?
virtual void bindArguments(Arguments &)=0
store a set of parameter values within this closure
virtual bool isValid() const =0
does this closure hold a valid argument tuple?
virtual void invoke(CmdFunctor const &)=0
invoke functor using the stored parameter values
virtual void unbindArguments()=0
discard any parameters and return to unbound state
virtual void accept(CommandImplCloneBuilder &) const =0
assist with creating clone closure without disclosing concrete type
virtual void bindArguments(lib::diff::Rec const &)=0
store a set of parameter values, passed as GenNode sequence
Visitor to support creating a CommandImpl clone.
Generic holder for functor objects, concealing the concrete function type.
Generic building block for tree shaped (meta)data structures.
enable_if_c< Cond::value, T >::type enable_if
SFINAE helper to control the visibility of specialisations and overloads.
Definition meta/util.hpp:87
std::shared_ptr< CmdClosure > PClo
Steam-Layer implementation namespace root.
Generic wrapper carrying a function object while hiding the actual function signature.