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

Defines data for a thread belonging to a InstrumentBase instance. Refer to RunnableInstance. More...

#include <Instrument.h>

+ Inheritance diagram for DynExp::InstrumentInstance:

Public Member Functions

 InstrumentInstance (InstrumentBase &Owner, std::promise< void > &&ThreadExitedPromise, const InstrumentBase::InstrumentDataGetterType InstrumentDataGetter)
 Constructs a non-empty RunnableInstance instance.
 
 InstrumentInstance (InstrumentInstance &&Other)
 Move-constructs a RunnableInstance instance. Other becomes empty. Not noexcept since LinkedObjectWrapperBase::ListType (std::list) move constructor might throw.
 
 ~InstrumentInstance ()=default
 
- Public Member Functions inherited from DynExp::RunnableInstance
 ~RunnableInstance ()
 
const auto & GetOwner () const noexcept
 Returns Owner.
 
void BlockUntilReadyToStart () const noexcept
 Blocks until ThreadMayStart is set to true. Thread functions to be run by RunnableObject instances are required to call this function before they access the parameters passed to them (except to call this function).
 
template<typename ObjectT >
void TryLockObject (const ParamsBase::Param< ObjectLink< ObjectT > > &LinkParam, LinkedObjectWrapperContainer< ObjectT > &ObjectWrapperContainer, std::chrono::milliseconds Timeout=ObjectLinkBase::LockObjectTimeoutDefault)
 Locks an Object instance referenced by a parameter LinkParam of type ParamsBase::Param< ObjectLink< ObjectT > > and makes the LinkedObjectWrapperContainer ObjectWrapperContainer point to the locked resource.
 
template<typename ObjectT >
void LockObject (const ParamsBase::Param< ObjectLink< ObjectT > > &LinkParam, LinkedObjectWrapperContainer< ObjectT > &ObjectWrapperContainer, std::chrono::milliseconds Timeout=ObjectLinkBase::LockObjectTimeoutDefault)
 Locks an Object instance referenced by a parameter LinkParam of type ParamsBase::Param< ObjectLink< ObjectT > > and makes the LinkedObjectWrapperContainer ObjectWrapperContainer point to the locked resource.
 
template<typename ObjectT >
void UnlockObject (LinkedObjectWrapperContainer< ObjectT > &ObjectWrapperContainer)
 Unlocks an Object instance stored in the LinkedObjectWrapperContainer ObjectWrapperContainer. The LinkedObjectWrapperPointer contained in ObjectWrapperContainer is invalidated (set to nullptr)!
 
template<typename ObjectT >
void LockObject (const ParamsBase::ListParam< ObjectLink< ObjectT > > &LinkListParam, LinkedObjectWrapperContainerList< ObjectT > &ObjectWrapperContainerList, std::chrono::milliseconds Timeout=ObjectLinkBase::LockObjectTimeoutDefault)
 Locks Object instances referenced by a list parameter LinkListParam of type ParamsBase::ListParam< ObjectLink< ObjectT > > and creates containers in LinkedObjectWrapperContainerList ObjectWrapperContainerList which point to the locked resources.
 
template<typename ObjectT >
void UnlockObject (LinkedObjectWrapperContainerList< ObjectT > &ObjectWrapperContainerList)
 Unlocks Object instances stored in the LinkedObjectWrapperContainerList ObjectWrapperContainerList.
 
bool CareAboutWrappers ()
 Unregisters owned LinkedObjectWrapper instances from their destiny resources in case of the respective destiny resource not being in a ready state (e.g. a stopped/error state). Registers again after the respective destiny resource has returned to a ready state.
 
std::string GetNotReadyObjectNamesString () const
 Finds all linked Object instances Owner makes use of which are not in a ready state and builds a string identifying all these Object instances.
 
- Public Member Functions inherited from Util::INonCopyable
 INonCopyable (const INonCopyable &)=delete
 
INonCopyableoperator= (const INonCopyable &)=delete
 

Public Attributes

const InstrumentBase::InstrumentDataGetterType InstrumentDataGetter
 Getter for instrument's data. Refer to InstrumentBase::InstrumentDataGetterType.
 
- Public Attributes inherited from DynExp::RunnableInstance
const Object::ParamsGetterType ParamsGetter
 Invoke to obtain the parameters (derived from ParamsBase) of Owner.
 
RunnableObjectOnlyType RunnableObjectOnly
 Allow exclusive access to some of RunnableInstance's private variables to RunnableObject.
 

Additional Inherited Members

- Protected Member Functions inherited from DynExp::RunnableInstance
 RunnableInstance (RunnableObject &Owner, std::promise< void > &&ThreadExitedPromise)
 Constructs a non-empty RunnableInstance instance.
 
 RunnableInstance (RunnableInstance &&Other)
 Move-constructs a RunnableInstance instance. Other becomes empty. Not noexcept since LinkedObjectWrapperBase::ListType (std::list) move constructor might throw.
 
- Protected Member Functions inherited from Util::INonCopyable
constexpr INonCopyable ()=default
 
 ~INonCopyable ()=default
 

Detailed Description

Defines data for a thread belonging to a InstrumentBase instance. Refer to RunnableInstance.

Definition at line 812 of file Instrument.h.

Constructor & Destructor Documentation

◆ InstrumentInstance() [1/2]

DynExp::InstrumentInstance::InstrumentInstance ( InstrumentBase Owner,
std::promise< void > &&  ThreadExitedPromise,
const InstrumentBase::InstrumentDataGetterType  InstrumentDataGetter 
)

Constructs a non-empty RunnableInstance instance.

Parameters
OwnerRefer to Owner.
ThreadExitedPromiseRefer to ThreadExitedPromise.
InstrumentDataGetterGetter for instrument's data. Refer to InstrumentBase::InstrumentDataGetterType.

Definition at line 478 of file Instrument.cpp.

◆ InstrumentInstance() [2/2]

DynExp::InstrumentInstance::InstrumentInstance ( InstrumentInstance &&  Other)

Move-constructs a RunnableInstance instance. Other becomes empty. Not noexcept since LinkedObjectWrapperBase::ListType (std::list) move constructor might throw.

Parameters
OtherRunnableInstance instance to move from

Definition at line 485 of file Instrument.cpp.

◆ ~InstrumentInstance()

DynExp::InstrumentInstance::~InstrumentInstance ( )
default

Member Data Documentation

◆ InstrumentDataGetter

const InstrumentBase::InstrumentDataGetterType DynExp::InstrumentInstance::InstrumentDataGetter

Getter for instrument's data. Refer to InstrumentBase::InstrumentDataGetterType.

Definition at line 832 of file Instrument.h.


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