Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
command-queue.hpp
Go to the documentation of this file.
1/*
2 COMMAND-QUEUE.hpp - organise ordering of commands within SteamDispatcher
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
14
33#ifndef STEAM_CONTROL_COMMAND_QUEUE_H
34#define STEAM_CONTROL_COMMAND_QUEUE_H
35
37#include "lib/iter-stack.hpp"
38#include "lib/format-string.hpp"
39#include "lib/util.hpp"
40
41
42namespace steam {
43namespace control {
44
45 namespace error = lumiera::error;
46
47 using util::_Fmt;
48 using lib::unConst;
49
50
51
57 : public lib::IterQueue<Command>
58 {
59
60 public:
62
63
66 {
67 if (not cmd.canExec())
68 throw error::Logic(_Fmt("Reject '%s'. Not suitably prepared for invocation: %s")
69 % cmd.getID() % cmd
70 , LERR_(UNBOUND_ARGUMENTS));
71
73 return *this;
74 }
75
76 void
78 {
79 this->stateCore().clear();
80 }
81 };
82
83
84
85}} // namespace steam::control
86#endif /*STEAM_CONTROL_COMMAND_QUEUE_H*/
ST & stateCore()
allow derived classes to access state representation
Implementation of the Session's command queue.
CommandQueue & feed(Command &&cmd)
Handle object representing a single Command instance to be used by client code.
Definition command.hpp:120
A front-end for using printf-style formatting.
Steam-Layer command frontend.
#define LERR_(_NAME_)
Definition error.hpp:45
Front-end for printf-style string template interpolation.
Conveniently iterable stack and queue containers.
enable_if_c< Cond::value, T >::type enable_if
SFINAE helper to control the visibility of specialisations and overloads.
Definition meta/util.hpp:87
LumieraError< LERR_(LOGIC)> Logic
Definition error.hpp:207
Steam-Layer implementation namespace root.
A Queue which can be pulled by iterating.
IterQueue & feed(TY const &elm)
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...