Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
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
52namespace steam {
53namespace 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() {}
108 };
109
110
111
112}} // namespace steam::control
113
114
115extern "C" {
116#endif /* =========================== CL Interface ===================== */
117
118
119#include "common/interface.h"
120
121LUMIERA_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*/
Access point to singletons and other kinds of dependencies designated by type.
Definition depend.hpp:281
Helper to abstract creation and lifecycle of a dependency.
Definition depend.hpp:127
Token or Atom with distinct identity.
Definition symbol.hpp:120
object-like record of data.
Definition record.hpp:142
Global access point to invoke commands and cause edit operations within the Session.
virtual void invoke(Symbol cmdID)=0
trigger invocation of a prepared command
static lib::Depend< SessionCommand > facade
static storage for the facade access front-end
virtual ~SessionCommand()
this is an interface
virtual Symbol cycle(Symbol cmdID, string const &invocationID)=0
start next command cycle and "open" a new anonymous command instance
virtual void bindArg(Symbol cmdID, lib::diff::Rec const &args)=0
prepare command invocation: bind the command's arguments
virtual void trigger(Symbol cmdID, lib::diff::Rec const &args)=0
bind the command's arguments and trigger command invocation immediately
Singleton services and Dependency Injection.
Generic building block for tree shaped (meta)data structures.
Lumiera interface macros and structures.
#define LUMIERA_INTERFACE_DECLARE(name, version,...)
Declare an interface.
Definition interface.h:154
enable_if_c< Cond::value, T >::type enable_if
SFINAE helper to control the visibility of specialisations and overloads.
Definition meta/util.hpp:87
Steam-Layer implementation namespace root.
Marker types to indicate a literal string and a Symbol.