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)
5  2016, 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 
38 #ifndef STEAM_CONTROL_SESSION_COMMAND_H
39 #define STEAM_CONTROL_SESSION_COMMAND_H
40 
41 
42 
43 #ifdef __cplusplus /* ============== C++ Interface ================= */
44 
45 #include "lib/depend.hpp"
46 #include "lib/diff/gen-node.hpp"
47 #include "lib/symbol.hpp"
48 
49 #include <string>
50 
51 
52 namespace steam {
53 namespace control {
54 
55  using lib::Symbol;
56  using std::string;
57 
58 
59  /**********************************************************************/
88  {
89  public:
91 
93  virtual Symbol cycle (Symbol cmdID, string const& invocationID) =0;
94 
96  virtual void trigger (Symbol cmdID, lib::diff::Rec const& args) =0;
97 
99  virtual void bindArg (Symbol cmdID, lib::diff::Rec const& args) =0;
100 
102  virtual void invoke (Symbol cmdID) =0;
103 
104 
105  protected:
106  virtual ~SessionCommand() {}
107  friend class lib::DependencyFactory<SessionCommand>;
108  };
109 
110 
111 
112 }} // namespace steam::control
113 
114 
115 extern "C" {
116 #endif /* =========================== CL Interface ===================== */
117 
118 
119 #include "common/interface.h"
120 
121 LUMIERA_INTERFACE_DECLARE (lumieraorg_SessionCommand, 0,
122  LUMIERA_INTERFACE_SLOT (const char*, cycle, (const char*, const char*)),
123  LUMIERA_INTERFACE_SLOT (void, trigger, (const char*, const void*)),
124  LUMIERA_INTERFACE_SLOT (void, bindArg, (const char*, const void*)),
125  LUMIERA_INTERFACE_SLOT (void, invoke, (const char*)),
126 );
127 
128 
129 #ifdef __cplusplus
130 }// extern "C"
131 #endif
132 #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:154
Steam-Layer implementation namespace root.
Access point to singletons and other kinds of dependencies designated by type.
Definition: depend.hpp:280
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:117
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:125
object-like record of data.
Definition: record.hpp:141
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