Lumiera  0.pre.03
»edit your freedom«
session-command-facade.h
Go to the documentation of this file.
1 /*
2  SESSION-COMMAND-FACADE.h - access point for invoking commands on the session
3 
4  Copyright (C) Lumiera.org
5  2016, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
47 #ifndef STEAM_CONTROL_SESSION_COMMAND_H
48 #define STEAM_CONTROL_SESSION_COMMAND_H
49 
50 
51 
52 #ifdef __cplusplus /* ============== C++ Interface ================= */
53 
54 #include "lib/depend.hpp"
55 #include "lib/diff/gen-node.hpp"
56 #include "lib/symbol.hpp"
57 
58 #include <string>
59 
60 
61 namespace steam {
62 namespace control {
63 
64  using lib::Symbol;
65  using std::string;
66 
67 
68  /**********************************************************************/
97  {
98  public:
100 
102  virtual Symbol cycle (Symbol cmdID, string const& invocationID) =0;
103 
105  virtual void trigger (Symbol cmdID, lib::diff::Rec const& args) =0;
106 
108  virtual void bindArg (Symbol cmdID, lib::diff::Rec const& args) =0;
109 
111  virtual void invoke (Symbol cmdID) =0;
112 
113 
114  protected:
115  virtual ~SessionCommand() {}
116  friend class lib::DependencyFactory<SessionCommand>;
117  };
118 
119 
120 
121 }} // namespace steam::control
122 
123 
124 extern "C" {
125 #endif /* =========================== CL Interface ===================== */
126 
127 
128 #include "common/interface.h"
129 
130 LUMIERA_INTERFACE_DECLARE (lumieraorg_SessionCommand, 0,
131  LUMIERA_INTERFACE_SLOT (const char*, cycle, (const char*, const char*)),
132  LUMIERA_INTERFACE_SLOT (void, trigger, (const char*, const void*)),
133  LUMIERA_INTERFACE_SLOT (void, bindArg, (const char*, const void*)),
134  LUMIERA_INTERFACE_SLOT (void, invoke, (const char*)),
135 );
136 
137 
138 #ifdef __cplusplus
139 }// extern "C"
140 #endif
141 #endif /*STEAM_CONTROL_SESSION_COMMAND_H*/
virtual ~SessionCommand()
this is an interface
Global access point to invoke commands and cause edit operations within the Session.
#define LUMIERA_INTERFACE_DECLARE(name, version,...)
Declare an interface.
Definition: interface.h:163
Steam-Layer implementation namespace root.
Access point to singletons and other kinds of dependencies designated by type.
Definition: depend.hpp:289
static lib::Depend< SessionCommand > facade
static storage for the facade access front-end
virtual void bindArg(Symbol cmdID, lib::diff::Rec const &args)=0
prepare command invocation: bind the command&#39;s arguments
Lumiera interface macros and structures.
Token or Atom with distinct identity.
Definition: symbol.hpp:126
Marker types to indicate a literal string and a Symbol.
Generic building block for tree shaped (meta)data structures.
Singleton services and Dependency Injection.
virtual void invoke(Symbol cmdID)=0
trigger invocation of a prepared command
Helper to abstract creation and lifecycle of a dependency.
Definition: depend.hpp:134
object-like record of data.
Definition: record.hpp:150
virtual void trigger(Symbol cmdID, lib::diff::Rec const &args)=0
bind the command&#39;s arguments and trigger command invocation immediately
virtual Symbol cycle(Symbol cmdID, string const &invocationID)=0
start next command cycle and "open" a new anonymous command instance