Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
command-instance-manager.hpp
Go to the documentation of this file.
1/*
2 COMMAND-INSTANCE-MANAGER.hpp - Service to manage command instances for actual invocation
3
4 Copyright (C)
5 2017, 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
48#ifndef CONTROL_COMMAND_INSTANCE_MANAGER_H
49#define CONTROL_COMMAND_INSTANCE_MANAGER_H
50
51#include "lib/error.hpp"
52#include "lib/nocopy.hpp"
55#include "lib/diff/gen-node.hpp"
56#include "lib/symbol.hpp"
57
58#include <unordered_map>
59#include <string>
60
61
62
63namespace steam {
64namespace control {
65
66 using std::string;
67 using lib::Symbol;
68 using lib::diff::Rec;
69
70
92 {
94 std::unordered_map<Symbol,Command> table_;
95
96 public:
99
101 Command getInstance(Symbol instanceID);
102 void dispatch (Symbol instanceID);
103 void bindAndDispatch (Symbol instanceID, Rec const& argSeq);
104
105 bool contains (Symbol instanceID) const;
106
107 private:
109 void handOver (Command&&);
110 };
111
112
113
114}} // namespace steam::control
115#endif /*CONTROL_COMMAND_INSTANCE_MANAGER_H*/
Token or Atom with distinct identity.
Definition symbol.hpp:120
object-like record of data.
Definition record.hpp:142
Interface of a service to perform Commands on the session.
Maintain a current command instance for parametrisation.
bool contains(Symbol instanceID) const
Command getInstance(Symbol instanceID)
access the currently "opened" instance with the given instanceID
void bindAndDispatch(Symbol instanceID, Rec const &argSeq)
fire and forget anonymous command instance.
void dispatch(Symbol instanceID)
hand over the designated command instance to the dispatcher installed on construction.
std::unordered_map< Symbol, Command > table_
Symbol newInstance(Symbol prototypeID, string const &invocationID)
Create and thus "open" a new anonymous command instance.
Handle object representing a single Command instance to be used by client code.
Definition command.hpp:120
Any copy and copy construction prohibited.
Definition nocopy.hpp:38
Interface to abstract the SteamDispatcher's ability to handle command messages.
Steam-Layer command frontend.
Lumiera error handling (C++ interface).
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
Steam-Layer implementation namespace root.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
Marker types to indicate a literal string and a Symbol.