DynExp
Highly flexible laboratory automation for dynamically changing experiments.
Loading...
Searching...
No Matches
DynExp::TaskResultType Class Reference

Defines the return type of task functions. More...

#include <Instrument.h>

Public Types

enum class  ContinuationType : bool { Continue , Terminate }
 Determines whether an instrument should terminate after handling a task. More...
 
enum class  AbortedType : bool { NotAborted , Aborted }
 Determines whether a task has been aborted. More...
 

Public Member Functions

constexpr TaskResultType (const ContinuationType Continue=ContinuationType::Continue, const AbortedType Aborted=AbortedType::NotAborted, const int ErrorCode=0) noexcept
 Constructs a TaskResultType instance.
 
constexpr bool ShouldContinue () const noexcept
 Determines whether the instrument having handled this task should continue or terminate.
 
constexpr InstrumentBase::TaskHandlingContinuationType ToTaskHandlingContinuationType () const noexcept
 Converts Continue to InstrumentBase::TaskHandlingContinuationType.
 
constexpr bool HasAborted () const noexcept
 Determines whether this task has been aborted.
 
constexpr int GetErrorCode () const noexcept
 Getter for the error code of an error which occurred during execution of the task function.
 

Private Attributes

const ContinuationType Continue
 Determines whether an instrument should terminate after handling a task.
 
const AbortedType Aborted
 Determines whether a task has been aborted.
 
const int ErrorCode
 DynExp error code from DynExpErrorCodes::DynExpErrorCodes. Anything else than 0 indicates an error.
 

Detailed Description

Defines the return type of task functions.

Definition at line 864 of file Instrument.h.

Member Enumeration Documentation

◆ AbortedType

enum class DynExp::TaskResultType::AbortedType : bool
strong

Determines whether a task has been aborted.

Enumerator
NotAborted 

The task has not been aborted.

Aborted 

The task has been aborted.

Definition at line 878 of file Instrument.h.

◆ ContinuationType

enum class DynExp::TaskResultType::ContinuationType : bool
strong

Determines whether an instrument should terminate after handling a task.

Enumerator
Continue 

Task handling should continue, the instrument does not terminate.

Terminate 

Task handling should not continue, the instrument should terminate.

Definition at line 870 of file Instrument.h.

Constructor & Destructor Documentation

◆ TaskResultType()

constexpr DynExp::TaskResultType::TaskResultType ( const ContinuationType  Continue = ContinuationType::Continue,
const AbortedType  Aborted = AbortedType::NotAborted,
const int  ErrorCode = 0 
)
inlineconstexprnoexcept

Constructs a TaskResultType instance.

Parameters
ContinueDetermines whether an instrument should terminate after handling a task.
AbortedDetermines whether a task has been aborted.
ErrorCodeDynExp error code from DynExpErrorCodes::DynExpErrorCodes. Anything else than 0 indicates an error.

Definition at line 889 of file Instrument.h.

Member Function Documentation

◆ GetErrorCode()

constexpr int DynExp::TaskResultType::GetErrorCode ( ) const
inlineconstexprnoexcept

Getter for the error code of an error which occurred during execution of the task function.

Returns
Returns ErrorCode.

Definition at line 915 of file Instrument.h.

◆ HasAborted()

constexpr bool DynExp::TaskResultType::HasAborted ( ) const
inlineconstexprnoexcept

Determines whether this task has been aborted.

Returns
Returns true if the task has been aborted, false otherwise.

Definition at line 909 of file Instrument.h.

◆ ShouldContinue()

constexpr bool DynExp::TaskResultType::ShouldContinue ( ) const
inlineconstexprnoexcept

Determines whether the instrument having handled this task should continue or terminate.

Returns
Returns true if the instrument should continue handling other tasks or false if the instrument should terminate.

Definition at line 897 of file Instrument.h.

◆ ToTaskHandlingContinuationType()

constexpr InstrumentBase::TaskHandlingContinuationType DynExp::TaskResultType::ToTaskHandlingContinuationType ( ) const
constexprnoexcept

Converts Continue to InstrumentBase::TaskHandlingContinuationType.

Returns
Returns an instance of InstrumentBase::TaskHandlingContinuationType.

Definition at line 490 of file Instrument.cpp.

Member Data Documentation

◆ Aborted

const AbortedType DynExp::TaskResultType::Aborted
private

Determines whether a task has been aborted.

Definition at line 919 of file Instrument.h.

◆ Continue

const ContinuationType DynExp::TaskResultType::Continue
private

Determines whether an instrument should terminate after handling a task.

Definition at line 918 of file Instrument.h.

◆ ErrorCode

const int DynExp::TaskResultType::ErrorCode
private

DynExp error code from DynExpErrorCodes::DynExpErrorCodes. Anything else than 0 indicates an error.

Definition at line 920 of file Instrument.h.


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