DynExp
Highly flexible laboratory automation for dynamically changing experiments.
DynExp::InstrumentBase::InstrumenThreadOnlyType Class Reference

Allow exclusive access to some of InstrumentBase's private methods to the instrument thread InstrumentThreadMain(). More...

Private Member Functions

constexpr InstrumenThreadOnlyType (InstrumentBase &Parent) noexcept
 Construcs an instance - one for each InstrumentBase instance. More...
 
bool HandleTask (InstrumentInstance &Instance)
 Executes and removes the next pending task from the instrument's task queue. More...
 
void UpdateData ()
 Inserts an update task (UpdateTaskBase) into the instrument's task queue. Override UpdateAdditionalData() to adjust behavior. More...
 
void OnError ()
 Derived classes can perform critical shutdown actions after an error has occurred. Override OnErrorChild() to adjust behavior. More...
 
void SetInitialized ()
 Sets InstrumentBase::Initialized to true. More...
 

Private Attributes

InstrumentBaseParent
 Owning InstrumentBase instance. More...
 

Friends

class InstrumentBase
 
int InstrumentThreadMain (InstrumentInstance, InstrumentBase *const)
 Instruments run in their own thread. This is the instrument thread's main function. More...
 

Detailed Description

Allow exclusive access to some of InstrumentBase's private methods to the instrument thread InstrumentThreadMain().

Definition at line 456 of file Instrument.h.

Constructor & Destructor Documentation

◆ InstrumenThreadOnlyType()

constexpr DynExp::InstrumentBase::InstrumenThreadOnlyType::InstrumenThreadOnlyType ( InstrumentBase Parent)
inlineconstexprprivatenoexcept

Construcs an instance - one for each InstrumentBase instance.

Parameters
ParentOwning InstrumentBase instance

Definition at line 465 of file Instrument.h.

Member Function Documentation

◆ HandleTask()

bool DynExp::InstrumentBase::InstrumenThreadOnlyType::HandleTask ( InstrumentInstance Instance)
inlineprivate

Executes and removes the next pending task from the instrument's task queue.

Parameters
InstanceHandle to the instrument thread's data
Returns
Returns false if task handling (the instrument) should stop, true otherwise.

Definition at line 467 of file Instrument.h.

◆ OnError()

void DynExp::InstrumentBase::InstrumenThreadOnlyType::OnError ( )
inlineprivate

Derived classes can perform critical shutdown actions after an error has occurred. Override OnErrorChild() to adjust behavior.

Definition at line 469 of file Instrument.h.

◆ SetInitialized()

void DynExp::InstrumentBase::InstrumenThreadOnlyType::SetInitialized ( )
inlineprivate

Sets InstrumentBase::Initialized to true.

Definition at line 470 of file Instrument.h.

◆ UpdateData()

void DynExp::InstrumentBase::InstrumenThreadOnlyType::UpdateData ( )
inlineprivate

Inserts an update task (UpdateTaskBase) into the instrument's task queue. Override UpdateAdditionalData() to adjust behavior.

Definition at line 468 of file Instrument.h.

Friends And Related Function Documentation

◆ InstrumentBase

friend class InstrumentBase
friend

Definition at line 458 of file Instrument.h.

◆ InstrumentThreadMain

int InstrumentThreadMain ( InstrumentInstance  ,
InstrumentBase * const   
)
friend

Instruments run in their own thread. This is the instrument thread's main function.

Parameters
InstanceHandle to the instrument thread's data related to the instrument running this thread. The instrument thread is expected to let the lifetime of Instance expire upon termination.
InstrumentPointer to the instrument running this thread
Returns
Util::DynExpErrorCodes::NoError if the thread terminated without an error, the respective error code otherwise.

Definition at line 8 of file Instrument.cpp.

Member Data Documentation

◆ Parent

InstrumentBase& DynExp::InstrumentBase::InstrumenThreadOnlyType::Parent
private

Owning InstrumentBase instance.

Definition at line 472 of file Instrument.h.


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