Lumiera  0.pre.03
»edit your freedom«
HandlingPattern Class Referenceabstract

#include "steam/control/handling-pattern.hpp"

Description

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 87 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
 

Member Function Documentation

◆ exec()

ExecResult exec ( CommandImpl command,
string  id 
) const
inline

main functionality: invoke a command, detect errors.

Parameters
stringid of the command for error logging
Returns
ExecResult object, which might later be used to detect errors on execution

Definition at line 134 of file handling-pattern.hpp.

◆ invoke()

ExecResult invoke ( CommandImpl command,
string  id,
Action  action 
) const
private

dispatch to the desired operation, with error handling

Definition at line 46 of file handling-pattern.cpp.

References cStr(), lumiera_error(), and Error::what().

+ Here is the call graph for this function:
+ Inheritance diagram for HandlingPattern:
+ Collaboration diagram for HandlingPattern:

The documentation for this class was generated from the following files: