68 #ifndef CONTROL_COMMAND_H 69 #define CONTROL_COMMAND_H 102 using FuncPtr =
void*;
127 , lib::Handle<CommandImpl>
135 static bool remove (
Symbol cmdID);
158 template<
typename...TYPES>
159 Command& bindArg (std::tuple<TYPES...>
const&);
185 HandlingPattern::ID getDefaultHandlingPattern()
const;
189 HandlingPattern::ID setHandlingPattern (HandlingPattern::ID);
195 static size_t definition_count();
196 static size_t instance_count();
198 bool canExec()
const;
199 bool canUndo()
const;
201 static bool defined (
Symbol cmdID);
202 static bool canExec (
Symbol cmdID);
203 static bool canUndo (
Symbol cmdID);
205 void duplicate_detected (
Symbol)
const;
207 Symbol getID()
const noexcept;
208 bool isAnonymous()
const;
210 operator string()
const;
232 Command::operator() ()
234 return exec (getDefaultHandlingPattern());
240 return exec (getDefaultHandlingPattern());
246 return undo (getDefaultHandlingPattern());
250 template<
typename...TYPES>
252 Command::bindArg (std::tuple<TYPES...>
const& tuple)
255 this->setArguments (args);
263 this->setArguments (paramData);
273 Command::defined (
Symbol cmdID)
275 return fetchDef(cmdID).isValid();
279 #define _FAILSAFE_COMMAND_QUERY(_ID_, _QUERY_) \ 282 return Command::get(_ID_)._QUERY_; \ 284 catch(lumiera::error::Invalid&) \ 292 Command::canExec (
Symbol cmdID)
294 _FAILSAFE_COMMAND_QUERY (cmdID, canExec() );
299 Command::canUndo (
Symbol cmdID)
301 _FAILSAFE_COMMAND_QUERY (cmdID, canUndo() );
304 #undef _FAILSAFE_COMMAND_QUERY 313 || ( c1 && c2 && (&c1.impl() == &c2.impl()));
319 return not (c1 == c2);
327 || ( 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.