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

Common base class for all derived ResourceManagerBase classes. Logical const-ness: Only const functions can be called from objects possessing a const handle to the DynExpCore instance. To protect the resource manager, some functions which should be non-const by that argument (ResourceManagerBase::Startup(), ResourceManagerBase::Shutdown(), ResourceManagerBase::ResetFailedResources()) are still const. These functions indirectly call Object::EnsureCallFromOwningThread() to ensure that they are only called by the main user interface thread (from the DynExpManager instance through its DynExpCore instance). Also refer to DynExpCore. More...

+ Inheritance diagram for DynExp::CommonResourceManagerBase:

Public Types

using FunctionToCallWhenObjectStartedType = const std::function< void(Object *const)>
 Type of a callback function to invoke after a resource has been started in a call to ResourceManagerBase::Startup(). The DynExp::Object instance owned by the respective resource is passed to the callback function. Refer e.g. to DynExpManager::RegisterModuleUI(), which is such a callback function. More...
 

Protected Member Functions

 CommonResourceManagerBase ()=default
 
 ~CommonResourceManagerBase ()=default
 

Static Protected Member Functions

static std::thread::id GetOwnerThreadID (const DynExpCore &Core) noexcept
 Getter for the thread id of the thread which constructed (and owns) Core. Implementation necessary in Managers.cpp to prevent cyclic includes caused by usage of DynExpCore in ResourceManagerBase::MakeEntriesFromXML(). More...
 

Detailed Description

Common base class for all derived ResourceManagerBase classes. Logical const-ness: Only const functions can be called from objects possessing a const handle to the DynExpCore instance. To protect the resource manager, some functions which should be non-const by that argument (ResourceManagerBase::Startup(), ResourceManagerBase::Shutdown(), ResourceManagerBase::ResetFailedResources()) are still const. These functions indirectly call Object::EnsureCallFromOwningThread() to ensure that they are only called by the main user interface thread (from the DynExpManager instance through its DynExpCore instance). Also refer to DynExpCore.

Definition at line 56 of file Managers.h.

Member Typedef Documentation

◆ FunctionToCallWhenObjectStartedType

Type of a callback function to invoke after a resource has been started in a call to ResourceManagerBase::Startup(). The DynExp::Object instance owned by the respective resource is passed to the callback function. Refer e.g. to DynExpManager::RegisterModuleUI(), which is such a callback function.

Definition at line 65 of file Managers.h.

Constructor & Destructor Documentation

◆ CommonResourceManagerBase()

DynExp::CommonResourceManagerBase::CommonResourceManagerBase ( )
protecteddefault

◆ ~CommonResourceManagerBase()

DynExp::CommonResourceManagerBase::~CommonResourceManagerBase ( )
protecteddefault

Member Function Documentation

◆ GetOwnerThreadID()

std::thread::id DynExp::CommonResourceManagerBase::GetOwnerThreadID ( const DynExpCore Core)
staticprotectednoexcept

Getter for the thread id of the thread which constructed (and owns) Core. Implementation necessary in Managers.cpp to prevent cyclic includes caused by usage of DynExpCore in ResourceManagerBase::MakeEntriesFromXML().

Parameters
CoreReference to DynExp's core
Returns
Returns the result of DynExpCore::GetOwnerThreadID() invoked on Core.

Definition at line 9 of file Managers.cpp.


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