59 #ifndef CONTROL_COMMAND_H 60 #define CONTROL_COMMAND_H 93 using FuncPtr =
void*;
118 , lib::Handle<CommandImpl>
126 static bool remove (
Symbol cmdID);
149 template<
typename...TYPES>
150 Command& bindArg (std::tuple<TYPES...>
const&);
176 HandlingPattern::ID getDefaultHandlingPattern()
const;
180 HandlingPattern::ID setHandlingPattern (HandlingPattern::ID);
186 static size_t definition_count();
187 static size_t instance_count();
189 bool canExec()
const;
190 bool canUndo()
const;
192 static bool defined (
Symbol cmdID);
193 static bool canExec (
Symbol cmdID);
194 static bool canUndo (
Symbol cmdID);
196 void duplicate_detected (
Symbol)
const;
198 Symbol getID()
const noexcept;
199 bool isAnonymous()
const;
201 operator string()
const;
223 Command::operator() ()
225 return exec (getDefaultHandlingPattern());
231 return exec (getDefaultHandlingPattern());
237 return undo (getDefaultHandlingPattern());
241 template<
typename...TYPES>
243 Command::bindArg (std::tuple<TYPES...>
const& tuple)
246 this->setArguments (args);
254 this->setArguments (paramData);
264 Command::defined (
Symbol cmdID)
266 return fetchDef(cmdID).isValid();
270 #define _FAILSAFE_COMMAND_QUERY(_ID_, _QUERY_) \ 273 return Command::get(_ID_)._QUERY_; \ 275 catch(lumiera::error::Invalid&) \ 283 Command::canExec (
Symbol cmdID)
285 _FAILSAFE_COMMAND_QUERY (cmdID, canExec() );
290 Command::canUndo (
Symbol cmdID)
292 _FAILSAFE_COMMAND_QUERY (cmdID, canUndo() );
295 #undef _FAILSAFE_COMMAND_QUERY 304 || ( c1 && c2 && (&c1.impl() == &c2.impl()));
310 return not (c1 == c2);
318 || ( c1 && c2 && (&c1.impl() < &c2.impl()));
Helper class used solely for defining a Command-Object.
Basic set of definitions and includes commonly used together.
typename BuildTupleType< TYPES >::Type Tuple
Build a std::tuple from types given as type sequence.
Implementation helper to bind Steam-Layer commands with arbitrary argument tuples.
Mixin-templates providing arbitrary function call operators and argument binding functions.
void undo(short param, int memento)
#define LUMIERA_ERROR_DECLARE(err)
Forward declare an error constant.
Steam-Layer implementation namespace root.
bool operator<(Command const &c1, Command const &c2)
allow for sets and associative containers
Metaprogramming with tuples-of-types and the std::tuple record.
Token or Atom with distinct identity.
Helper Template for control::Command, mix-in complete set of bind(...) functions. ...
Marker types to indicate a literal string and a Symbol.
Result (Status) of command execution.
Command()
undefined command
Generic building block for tree shaped (meta)data structures.
Pre-defined command execution skeletons.
Lumiera error handling (C++ interface).
Handle object representing a single Command instance to be used by client code.
Lumiera public interface.
A generic opaque handle to an implementation entity, including lifecycle management.
object-like record of data.
Interface: Operation Skeleton how to invoke or undo a command.