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

Allow exclusive access to some of ModuleBase's private methods to the module thread ModuleThreadMain(). More...

Private Member Functions

constexpr ModuleThreadOnlyType (ModuleBase &Parent) noexcept
 Construcs an instance - one for each ModuleBase instance.
 
void HandleEvent (ModuleInstance &Instance)
 
Util::DynExpErrorCodes::DynExpErrorCodes ModuleMainLoop (ModuleInstance &Instance)
 
void SetException (std::exception_ptr Exception) noexcept
 Sets this module instance to an error state and tries to store the exception responsible for the error state in ModuleData. If ModuleData cannot be locked, still atomically sets an error flag.
 
void OnPause (ModuleInstance &Instance)
 
void OnResume (ModuleInstance &Instance)
 
void OnError (ModuleInstance &Instance)
 
void SetReasonWhyPaused (std::string Description)
 

Private Attributes

ModuleBaseParent
 Owning ModuleBase instance.
 

Friends

class ModuleBase
 
int ModuleThreadMain (std::unique_ptr< RunnableInstance > &&, RunnableObject *)
 Modules run in their own thread. This is the module thread's main function.
 

Detailed Description

Allow exclusive access to some of ModuleBase's private methods to the module thread ModuleThreadMain().

Definition at line 433 of file Module.h.

Constructor & Destructor Documentation

◆ ModuleThreadOnlyType()

constexpr DynExp::ModuleBase::ModuleThreadOnlyType::ModuleThreadOnlyType ( ModuleBase Parent)
inlineconstexprprivatenoexcept

Construcs an instance - one for each ModuleBase instance.

Parameters
ParentOwning ModuleBase instance

Definition at line 442 of file Module.h.

Member Function Documentation

◆ HandleEvent()

void DynExp::ModuleBase::ModuleThreadOnlyType::HandleEvent ( ModuleInstance Instance)
inlineprivate

Definition at line 444 of file Module.h.

◆ ModuleMainLoop()

Util::DynExpErrorCodes::DynExpErrorCodes DynExp::ModuleBase::ModuleThreadOnlyType::ModuleMainLoop ( ModuleInstance Instance)
inlineprivate

Definition at line 445 of file Module.h.

◆ OnError()

void DynExp::ModuleBase::ModuleThreadOnlyType::OnError ( ModuleInstance Instance)
inlineprivate

Definition at line 449 of file Module.h.

◆ OnPause()

void DynExp::ModuleBase::ModuleThreadOnlyType::OnPause ( ModuleInstance Instance)
inlineprivate

Definition at line 447 of file Module.h.

◆ OnResume()

void DynExp::ModuleBase::ModuleThreadOnlyType::OnResume ( ModuleInstance Instance)
inlineprivate

Definition at line 448 of file Module.h.

◆ SetException()

void DynExp::ModuleBase::ModuleThreadOnlyType::SetException ( std::exception_ptr  Exception)
inlineprivatenoexcept

Sets this module instance to an error state and tries to store the exception responsible for the error state in ModuleData. If ModuleData cannot be locked, still atomically sets an error flag.

Parameters
ExceptionException to store.

Definition at line 446 of file Module.h.

◆ SetReasonWhyPaused()

void DynExp::ModuleBase::ModuleThreadOnlyType::SetReasonWhyPaused ( std::string  Description)
inlineprivate

Definition at line 451 of file Module.h.

Friends And Related Symbol Documentation

◆ ModuleBase

friend class ModuleBase
friend

Definition at line 435 of file Module.h.

◆ ModuleThreadMain

int ModuleThreadMain ( std::unique_ptr< RunnableInstance > &&  ,
RunnableObject  
)
friend

Modules run in their own thread. This is the module thread's main function.

Parameters
InstancePtrPointer to a handle to the module thread's data related to the module running this thread. The module thread takes ownership of InstancePtr and is expected to let the lifetime of InstancePtr expire upon termination.
BaseObjectPointer to the module running this thread.
Returns
Util::DynExpErrorCodes::NoError if the thread terminated without an error, the respective error code otherwise.

Definition at line 10 of file Module.cpp.

Member Data Documentation

◆ Parent

ModuleBase& DynExp::ModuleBase::ModuleThreadOnlyType::Parent
private

Owning ModuleBase instance.

Definition at line 453 of file Module.h.


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