Lumiera
0.pre.03
»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 http://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 268 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. More... | |
bool | isValid () const |
is this a valid command definition? especially. More... | |
template<typename FUN > | |
auto | operation (FUN operation_to_define) |
operator bool () const | |
Private Types | |
using | Activation = stage::Activation |
using | PImpl = stage::ImplInstance |
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. More... | |
Private Member Functions inherited from NonCopyable | |
NonCopyable (NonCopyable const &)=delete | |
NonCopyable & | operator= (NonCopyable const &)=delete |
Private Attributes | |
Symbol | id_ |
Command | prototype_ |
~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.
bool isValid | ( | ) | const |
is this a valid command definition? especially.
Definition at line 340 of file command.cpp.
callback from completed command definition stage: "arm up" the command handle object and register it with the CommandRegistry.
Definition at line 311 of file command-def.hpp.
References Command::activate().