Lumiera  0.pre.03
»edit your freedom«
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 
70 namespace steam {
71 namespace control {
72 
75 
76  using std::string;
77 
78 
79 
85 
87 
88 
89 
90 
92  class CmdClosure
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 
110 
111 
112 
113 }} // namespace steam::control
114 #endif /*CONTROL_COMMAND_CLOSURE_H*/
virtual void accept(CommandImplCloneBuilder &) const =0
assist with creating clone closure without disclosing concrete type
FunErasure< StoreFunction > CmdFunctor
A neutral container internally holding the functor used to implement the Command. ...
Implementation helper to bind Steam-Layer commands with arbitrary argument tuples.
Steam-Layer implementation namespace root.
virtual bool isCaptured() const =0
does this closure hold captured UNDO state?
virtual void invoke(CmdFunctor const &)=0
invoke functor using the stored parameter values
Generic wrapper carrying a function object while hiding the actual function signature.
Policy for FunErasure: store an embedded std::function Using this policy allows to store arbitrary co...
Generic building block for tree shaped (meta)data structures.
Visitor to support creating a CommandImpl clone.
Generic holder for functor objects, concealing the concrete function type.
virtual bool isValid() const =0
does this closure hold a valid argument tuple?
object-like record of data.
Definition: record.hpp:141
virtual void unbindArguments()=0
discard any parameters and return to unbound state
virtual void bindArguments(Arguments &)=0
store a set of parameter values within this closure