Lumiera
0.pre.03
»edit your freedom«
|
#include "steam/control/handling-pattern.hpp"
Interface: Operation Skeleton how to invoke or undo a command.
Concrete implementations may be retrieved by ID; they range from just invoking the command operations straight forward to dispatching with the SteamDispatcher or running the command asynchronously in a background thread.
Definition at line 96 of file handling-pattern.hpp.
Public Types | |
enum | ID { SYNC, SYNC_THROW, ASYNC, DUMMY, NUM_IDS } |
Public Member Functions | |
virtual | ~HandlingPattern () |
this is an interface | |
ExecResult | exec (CommandImpl &command, string) const |
main functionality: invoke a command, detect errors. More... | |
virtual bool | isValid () const =0 |
operator bool () const | |
ExecResult | undo (CommandImpl &command, string) const |
likewise invoke the configured UNDO operation | |
Static Public Member Functions | |
static ID | defaultID () |
static HandlingPattern const & | get (ID id) |
retrieve the pre-configured pattern | |
Protected Member Functions | |
virtual void | performExec (CommandImpl &command) const =0 |
virtual void | performUndo (CommandImpl &command) const =0 |
Private Types | |
typedef void(HandlingPattern::* | Action) (CommandImpl &) const |
Private Member Functions | |
ExecResult | invoke (CommandImpl &, string id, Action) const |
|
inline |
main functionality: invoke a command, detect errors.
string | id of the command for error logging |
Definition at line 143 of file handling-pattern.hpp.
|
private |
dispatch to the desired operation, with error handling
Definition at line 55 of file handling-pattern.cpp.
References cStr(), lumiera_error(), and Error::what().