![]() |
Lumiera 0.pre.04~rc.1
»edit your freedom«
|
#include "steam/control/command-def.hpp"
Helper class used solely for defining a Command-Object.
This technique is known as "fluent API", see https://en.wikipedia.org/wiki/Fluent_interface The basic idea is for the user to create a disposable instance of this definition helper, only for calling a chain of definition functions, which internally build the actual Command object. Finally, the created Command object will be stored into a registry or handed over to the SteamDispatcher. To give an example:
Definition at line 265 of file command-def.hpp.
Public Member Functions | |
| CommandDef (Symbol cmdID) | |
| ~CommandDef () | |
| when starting a CommandDef, we immediately place a yet empty Command object into the index, just assuming it will be defined properly and consequently get valid at some point. | |
| template<typename FUN > | |
| auto | operation (FUN operation_to_define) |
| operator bool () const | |
| bool | isValid () const |
| is this a valid command definition? especially. | |
Private Types | |
| using | PImpl = stage::ImplInstance |
| using | Activation = stage::Activation |
Private Member Functions | |
| Command & | activate (PImpl &&completedDef) |
| callback from completed command definition stage: "arm up" the command handle object and register it with the CommandRegistry. | |
Private Member Functions inherited from NonCopyable | |
| ~NonCopyable ()=default | |
| NonCopyable ()=default | |
| NonCopyable (NonCopyable const &)=delete | |
| NonCopyable & | operator= (NonCopyable const &)=delete |
Private Attributes | |
| Symbol | id_ |
| Command | prototype_ |
|
inline |
Definition at line 275 of file command-def.hpp.
References Literal::c().
Here is the call graph for this function:| ~CommandDef | ( | ) |
when starting a CommandDef, we immediately place a yet empty Command object into the index, just assuming it will be defined properly and consequently get valid at some point.
But in case this doesn't happen (e.g. because the definition is aborted), we need to clean up this empty pre-registration...
Definition at line 326 of file command.cpp.
References CommandDef::id_, CommandRegistry::instance, CommandDef::prototype_, and Command::remove().
Here is the call graph for this function:
|
private |
Definition at line 271 of file command-def.hpp.
|
private |
Definition at line 272 of file command-def.hpp.
Definition at line 288 of file command-def.hpp.
References CommandDef::activate().
Referenced by CommandQueue_test::CommandQueue_test(), SessionCommandFunction_test::SessionCommandFunction_test(), CommandUse1_test::allInOneStep(), CommandUse1_test::definePrototype(), AbstractTangible_test::invokeCommand(), CommandBasic_test::run(), CommandEquality_test::run(), CommandMessageBinding_test::run(), CommandRegistry_test::run(), CommandUse2_test::run(), CommandUse3_test::run(), CommandUse1_test::standardUse(), CommandUse1_test::stringRepresentation(), and CommandBinding_test::zeroArgumentCommand().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineexplicit |
Definition at line 299 of file command-def.hpp.
References CommandDef::isValid().
Here is the call graph for this function:| bool isValid | ( | ) | const |
is this a valid command definition? especially.
Definition at line 340 of file command.cpp.
References CommandDef::id_, and CommandDef::prototype_.
Referenced by CommandDef::operator bool().
Here is the caller graph for this function:callback from completed command definition stage: "arm up" the command handle object and register it with the CommandRegistry.
Definition at line 308 of file command-def.hpp.
References Command::activate(), CommandDef::id_, and CommandDef::prototype_.
Referenced by CommandDef::operation().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 268 of file command-def.hpp.
Referenced by CommandDef::~CommandDef(), CommandDef::activate(), and CommandDef::isValid().
|
private |
Definition at line 269 of file command-def.hpp.
Referenced by CommandDef::~CommandDef(), CommandDef::activate(), and CommandDef::isValid().
Inheritance diagram for CommandDef:
Collaboration diagram for CommandDef: