Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
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
}
 

Static Public Member Functions

static ID defaultID ()
 
static HandlingPattern constget (ID id)
 retrieve the pre-configured pattern
 

Public Member Functions

virtual ~HandlingPattern ()
 this is an interface
 
ExecResult exec (CommandImpl &command, string) const
 main functionality: invoke a command, detect errors.
 
ExecResult undo (CommandImpl &command, string) const
 likewise invoke the configured UNDO operation
 
 operator bool () const
 
virtual bool isValid () const =0
 

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
 

Constructor & Destructor Documentation

◆ ~HandlingPattern()

virtual ~HandlingPattern ( )
inlinevirtual

this is an interface

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

Member Typedef Documentation

◆ Action

typedef void(HandlingPattern::* Action) (CommandImpl &) const
private

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

Member Enumeration Documentation

◆ ID

Enumerator
SYNC 
SYNC_THROW 
ASYNC 
DUMMY 
NUM_IDS 

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

Member Function Documentation

◆ defaultID()

static ID defaultID ( )
inlinestatic

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

References HandlingPattern::DUMMY.

◆ get()

HandlingPattern const & get ( ID  id)
static

retrieve the pre-configured pattern

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

Referenced by CommandUse2_test::check_ThrowOnError(), HandlingPatternBasics_test::checkExec(), HandlingPatternBasics_test::checkUndo(), Command::exec(), Command::execSync(), WrappedStandardExeBuilder::invokeOriginalBuilder(), CommandImpl::isValid(), Command::undo(), and CommandCloneBuilder_test::verifySeparation().

+ Here is the caller graph for this function:

◆ 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.

References HandlingPattern::invoke(), and HandlingPattern::performExec().

+ Here is the call graph for this function:

◆ undo()

ExecResult undo ( CommandImpl command,
string  id 
) const
inline

likewise invoke the configured UNDO operation

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

References HandlingPattern::invoke(), and HandlingPattern::performUndo().

+ Here is the call graph for this function:

◆ operator bool()

operator bool ( ) const
inlineexplicit

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

References HandlingPattern::isValid().

+ Here is the call graph for this function:

◆ isValid()

virtual bool isValid ( ) const
pure virtual

Implemented in BasicHandlingPattern, InvokeSyncNoThrow, InvokeSyncThrow, InvokeAsync, CustomHandler, and SimulatedCommandHandler.

Referenced by CommandImpl::isValid(), and HandlingPattern::operator bool().

+ Here is the caller graph for this function:

◆ performExec()

virtual void performExec ( CommandImpl command) const
protectedpure virtual

Implemented in BasicHandlingPattern, InvokeSyncNoThrow, InvokeSyncThrow, InvokeAsync, CustomHandler, and SimulatedCommandHandler.

Referenced by HandlingPattern::exec().

+ Here is the caller graph for this function:

◆ performUndo()

virtual void performUndo ( CommandImpl command) const
protectedpure virtual

Implemented in BasicHandlingPattern, InvokeSyncNoThrow, InvokeSyncThrow, InvokeAsync, CustomHandler, and SimulatedCommandHandler.

Referenced by HandlingPattern::undo().

+ Here is the caller graph for this function:

◆ 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(), and lumiera_error().

Referenced by HandlingPattern::exec(), and HandlingPattern::undo().

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

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