DynExp
Highly flexible laboratory automation for dynamically changing experiments.
DynExp::TaskBase::InstrumentBaseOnlyType Class Reference

Allow exclusive access to some of TaskBase's private methods to InstrumentBase. More...

Private Member Functions

constexpr InstrumentBaseOnlyType (TaskBase &Parent) noexcept
 Construcs an instance - one for each TaskBase instance. More...
 
void Lock ()
 Locks the task to prepare it for execution. More...
 
bool Run (InstrumentInstance &Instance)
 Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChild() will terminate the instrument thread. In this case, the instrument has to be reset in order to restart it. For minor errors occurring in RunChild(), return a TaskResultType instance with TaskResultType::ErrorCode set to an appropriate (non-zero) value. This sets State to TaskState::Failed. Note that in this case there might be no way to retrieve the error if finished tasks are not kept (i.e. KeepFinishedTask() returns false) and if no CallbackFunc has been set. RunChild() is supposed to check the return value of IsAborting(). More...
 

Private Attributes

TaskBaseParent
 Owning TaskBase instance. More...
 

Friends

class TaskBase
 
class InstrumentBase
 

Detailed Description

Allow exclusive access to some of TaskBase's private methods to InstrumentBase.

Definition at line 896 of file Instrument.h.

Constructor & Destructor Documentation

◆ InstrumentBaseOnlyType()

constexpr DynExp::TaskBase::InstrumentBaseOnlyType::InstrumentBaseOnlyType ( TaskBase Parent)
inlineconstexprprivatenoexcept

Construcs an instance - one for each TaskBase instance.

Parameters
ParentOwning TaskBase instance

Definition at line 905 of file Instrument.h.

Member Function Documentation

◆ Lock()

void DynExp::TaskBase::InstrumentBaseOnlyType::Lock ( )
inlineprivate

Locks the task to prepare it for execution.

Exceptions
Util::InvalidStateExceptionis thrown if the task is not in the TaskState::Waiting state.

Definition at line 907 of file Instrument.h.

◆ Run()

bool DynExp::TaskBase::InstrumentBaseOnlyType::Run ( InstrumentInstance Instance)
inlineprivate

Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChild() will terminate the instrument thread. In this case, the instrument has to be reset in order to restart it. For minor errors occurring in RunChild(), return a TaskResultType instance with TaskResultType::ErrorCode set to an appropriate (non-zero) value. This sets State to TaskState::Failed. Note that in this case there might be no way to retrieve the error if finished tasks are not kept (i.e. KeepFinishedTask() returns false) and if no CallbackFunc has been set. RunChild() is supposed to check the return value of IsAborting().

Parameters
InstanceHandle to the instrument thread's data
Returns
Returns true if task handling should continue, false if the instrument thread should terminate.
Exceptions
Util::InvalidStateExceptionis thrown if the task is not in the TaskState::Waiting or TaskState::Locked state.

Definition at line 908 of file Instrument.h.

Friends And Related Function Documentation

◆ InstrumentBase

friend class InstrumentBase
friend

Definition at line 899 of file Instrument.h.

◆ TaskBase

friend class TaskBase
friend

Definition at line 898 of file Instrument.h.

Member Data Documentation

◆ Parent

TaskBase& DynExp::TaskBase::InstrumentBaseOnlyType::Parent
private

Owning TaskBase instance.

Definition at line 910 of file Instrument.h.


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