DynExp
Highly flexible laboratory automation for dynamically changing experiments.
|
Defines data for a thread belonging to a ModuleBase
instance. Refer to RunnableInstance
.
More...
Public Member Functions | |
ModuleInstance (ModuleBase &Owner, std::promise< void > &&ThreadExitedPromise, const ModuleBase::ModuleDataGetterType ModuleDataGetter) | |
Constructs a non-empty RunnableInstance instance. More... | |
ModuleInstance (ModuleInstance &&Other) | |
Move-constructs a RunnableInstance instance. Other becomes empty. Not noexcept since LinkedObjectWrapperBase::ListType (std::list ) move constructor might throw. More... | |
~ModuleInstance ()=default | |
void | Exit () noexcept |
Might be called from anywhere where this ModuleInstance instance is accessible to make the associated module terminate. More... | |
bool | IsExiting () const noexcept |
Getter for ShouldExit. More... | |
Public Member Functions inherited from DynExp::RunnableInstance | |
const auto & | GetOwner () const noexcept |
Returns Owner. More... | |
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. More... | |
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. More... | |
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)! More... | |
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. More... | |
template<typename ObjectT > | |
void | UnlockObject (LinkedObjectWrapperContainerList< ObjectT > &ObjectWrapperContainerList) |
Unlocks Object instances stored in the LinkedObjectWrapperContainerList ObjectWrapperContainerList . More... | |
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. More... | |
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. More... | |
Public Member Functions inherited from Util::INonCopyable | |
INonCopyable (const INonCopyable &)=delete | |
INonCopyable & | operator= (const INonCopyable &)=delete |
Public Attributes | |
const ModuleBase::ModuleDataGetterType | ModuleDataGetter |
Getter for module's data. Refer to ModuleBase::ModuleDataGetterType. More... | |
Public Attributes inherited from DynExp::RunnableInstance | |
const Object::ParamsGetterType | ParamsGetter |
Invoke to obtain the parameters (derived from ParamsBase ) of Owner. More... | |
Private Attributes | |
bool | ShouldExit = false |
Indicates whether the module thread using this ModuleInstance instance should terminate. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from DynExp::RunnableInstance | |
RunnableInstance (RunnableObject &Owner, std::promise< void > &&ThreadExitedPromise) | |
Constructs a non-empty RunnableInstance instance. More... | |
RunnableInstance (RunnableInstance &&Other) | |
Move-constructs a RunnableInstance instance. Other becomes empty. Not noexcept since LinkedObjectWrapperBase::ListType (std::list ) move constructor might throw. More... | |
~RunnableInstance () | |
Protected Member Functions inherited from Util::INonCopyable | |
constexpr | INonCopyable ()=default |
~INonCopyable ()=default | |
Defines data for a thread belonging to a ModuleBase
instance. Refer to RunnableInstance
.
DynExp::ModuleInstance::ModuleInstance | ( | ModuleBase & | Owner, |
std::promise< void > && | ThreadExitedPromise, | ||
const ModuleBase::ModuleDataGetterType | ModuleDataGetter | ||
) |
Constructs a non-empty RunnableInstance
instance.
Owner | Refer to Owner. |
ThreadExitedPromise | Refer to ThreadExitedPromise. |
ModuleDataGetter | Getter for module's data. Refer to ModuleBase::ModuleDataGetterType. |
Definition at line 389 of file Module.cpp.
DynExp::ModuleInstance::ModuleInstance | ( | ModuleInstance && | Other | ) |
Move-constructs a RunnableInstance
instance. Other
becomes empty. Not noexcept since LinkedObjectWrapperBase::ListType (std::list
) move constructor might throw.
Other | RunnableInstance instance to move from |
Definition at line 396 of file Module.cpp.
|
default |
|
inlinenoexcept |
Might be called from anywhere where this ModuleInstance
instance is accessible to make the associated module terminate.
|
inlinenoexcept |
Getter for ShouldExit.
ModuleInstance
should terminate, false otherwise. const ModuleBase::ModuleDataGetterType DynExp::ModuleInstance::ModuleDataGetter |
Getter for module's data. Refer to ModuleBase::ModuleDataGetterType.
|
private |
Indicates whether the module thread using this ModuleInstance
instance should terminate.