#include <command.hpp>


Commands are accessed through a symbolic ID ; there needs to be a CommandDef somewhere to specify the actual operation and to define, how the effect of the command can be undone. Moreover, the command's definition refers to a HandlingPattern, which describes how the command is actually to be executed (the default is scheduling it within the ProcDispatcher)
Client code usually just
Definition at line 106 of file command.hpp.
Public Member Functions | |
| template<typename TYPES> | |
| Command & | bindArg (Tuple< TYPES > const &) |
| bool | canExec () const |
| bool | canUndo () const |
| Command () | |
| undefined command | |
| Command (Symbol cmdID) | |
| void | duplicate_detected (Symbol) const |
| ExecResult | exec (HandlingPattern::ID) |
| ExecResult | exec (HandlingPattern const &execPattern) |
| core operation: invoke the command | |
| ExecResult | execSync () |
| invoke using a default "synchronous" execution pattern | |
| HandlingPattern::ID | getDefaultHandlingPattern () const |
| Command | newInstance () const |
| create independent clone copy of this command | |
| operator string () const | |
| diagnostics: shows the commandID, if any, and the degree of definition of this command | |
| ExecResult | operator() () |
| HandlingPattern::ID | setHandlingPattern (HandlingPattern::ID) |
| define a handling pattern to be used by default | |
| Command | storeDef (Symbol newCmdID) const |
| create a clone definition | |
| ExecResult | undo () |
Static Public Member Functions | |
| static bool | canExec (Symbol cmdID) |
| static bool | canUndo (Symbol cmdID) |
| static bool | defined (Symbol cmdID) |
| static size_t | definition_count () |
| static Command | get (FuncPtr func) |
| static Command | get (Symbol cmdID) |
| Access existing command for use. | |
| static size_t | instance_count () |
| static bool | remove (Symbol cmdID) |
Protected Member Functions | |
| void | activate (shared_ptr< CommandImpl > const &, Symbol cmdID=0) |
Static Protected Member Functions | |
| static Command | fetchDef (Symbol cmdID) |
Private Types | |
| typedef lib::Handle< CommandImpl > | _Handle |
Private Member Functions | |
| void | setArguments (Arguments &) |
Static Private Member Functions | |
| static bool | equivalentImpl (Command const &, Command const &) |
Friends | |
| class | CommandDef |
| bool | operator< (Command const &, Command const &) |
| allow for sets and associative containers | |
| bool | operator== (Command const &, Command const &) |
| control::Command::Command | ( | ) | [inline] |
| void control::Command::activate | ( | shared_ptr< CommandImpl > const & | implFrame, | |
| Symbol | cmdID = 0 | |||
| ) | [protected] |
For internal use only.
make a command ready for use. Typically to be invoked through CommandDef during the definition stage, but also used for activating clone instances.
| cmdID | new ID for creating a separate command registration when provided |
| error::Logic | when this is already activated. |
Definition at line 151 of file command.cpp.
References lib::Handle< IMP >::activate(), and control::CommandRegistry::instance.
Referenced by control::CommandDef::activate(), newInstance(), and storeDef().


| size_t control::Command::definition_count | ( | ) | [static] |
Definition at line 245 of file command.cpp.
References control::CommandRegistry::instance.
| ExecResult control::Command::exec | ( | HandlingPattern const & | execPattern | ) |
core operation: invoke the command
| execPattern | describes the individual steps necessary to get this command invoked properly |
Definition at line 372 of file command.cpp.
References control::HandlingPattern::invoke().
Referenced by execSync().


| ExecResult control::Command::execSync | ( | ) |
invoke using a default "synchronous" execution pattern
Definition at line 390 of file command.cpp.
References exec(), and control::HandlingPattern::get().

For internal use only.
just query an existing instance, if any.
Definition at line 139 of file command.cpp.
References control::CommandRegistry::instance.
| Command control::Command::get | ( | FuncPtr | func | ) | [static] |
Definition at line 131 of file command.cpp.
Access existing command for use.
| error::Invalid | if command not registered or incompletely defined. |
Definition at line 112 of file command.cpp.
References control::CommandRegistry::instance, and asset::str().

| HandlingPattern::ID control::Command::getDefaultHandlingPattern | ( | ) | const |
| size_t control::Command::instance_count | ( | ) | [static] |
Definition at line 254 of file command.cpp.
References control::CommandRegistry::instance.
| Command control::Command::newInstance | ( | ) | const |
create independent clone copy of this command
Definition at line 187 of file command.cpp.
References activate(), control::CommandRegistry::createCloneImpl(), and control::CommandRegistry::instance.

| control::Command::operator string | ( | ) | const |
diagnostics: shows the commandID, if any, and the degree of definition of this command
Definition at line 332 of file command.cpp.
References control::CommandRegistry::instance.
| void control::Command::setArguments | ( | Arguments & | args | ) | [private] |
For internal use only.
pass a new argument tuple to the CommandImpl without exposing implementation.
Definition at line 235 of file command.cpp.
| HandlingPattern::ID control::Command::setHandlingPattern | ( | HandlingPattern::ID | pattID | ) |
define a handling pattern to be used by default
Definition at line 405 of file command.cpp.
create a clone definition
create an independent clone copy of this command and register it as new command definition under a different ID
Definition at line 170 of file command.cpp.
References activate(), control::CommandRegistry::createCloneImpl(), control::CommandRegistry::instance, and control::CommandRegistry::queryIndex().

1.5.6