Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
ExecResult Class Reference

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

Description

Result (Status) of command execution.

It is returned when invoking a HandlingPattern and can be used to check for success and/or re-throw any Exception encountered during the command execution.

Todo:
couldn't that be replaced by a lib::Result<void> instance??

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

Public Member Functions

bool isValid () const
 
void maybeThrow () const
 
 operator bool () const
 

Friends

class HandlingPattern
 

Protected Member Functions

 ExecResult ()
 default: command executed successfully
 
 ExecResult (lumiera::Error const &)
 this result marks a failed execution
 

Private Attributes

const string log_
 

Constructor & Destructor Documentation

◆ ExecResult() [1/2]

ExecResult ( )
inlineprotected

default: command executed successfully

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

◆ ExecResult() [2/2]

ExecResult ( lumiera::Error const problem)
protected

this result marks a failed execution

Note
just grab and retain the error message, but clear the error flag. Rationale: by packaging into the ExecResult, the excepton counts as treated.

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

References lumiera_error().

+ Here is the call graph for this function:

Member Function Documentation

◆ isValid()

bool isValid ( ) const

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

References ExecResult::log_.

Referenced by ExecResult::operator bool().

+ Here is the caller graph for this function:

◆ maybeThrow()

void maybeThrow ( ) const

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

References ExecResult::log_.

◆ operator bool()

operator bool ( ) const
inline

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

References ExecResult::isValid().

+ Here is the call graph for this function:

Member Data Documentation

◆ log_

const string log_
private

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

Referenced by ExecResult::isValid(), and ExecResult::maybeThrow().

Friends And Related Symbol Documentation

◆ HandlingPattern

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

+ Collaboration diagram for ExecResult:

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