DynExp
Highly flexible laboratory automation for dynamically changing experiments.
DynExp::ResourceManagerBase< PointerType > Class Template Referenceabstract

Typed resource manager base class deriving from class CommonResourceManagerBase. More...

+ Inheritance diagram for DynExp::ResourceManagerBase< PointerType >:

Classes

class  LinkBaseOnlyType
 Allow exclusive access to some of ResourceManagerBase's private methods to LinkBase. More...
 

Public Types

using ResourceType = Resource< PointerType >
 Type of the managed DynExp resources. More...
 
- Public Types inherited from DynExp::CommonResourceManagerBase
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...
 

Public Member Functions

ItemIDType GetNextID () const noexcept
 Getter for the ID to assign to the next resource to be inserted into the resource manager. More...
 
const auto GetNumResources () const noexcept
 Determines the amount of resources stored in this resource manager. More...
 
const bool Empty () const noexcept
 Determines whether this resource manager is empty. More...
 
const PointerType::element_type * GetResource (ItemIDType ID) const
 Retrieves a resource specified by its ID from the resource manager. More...
 
PointerType::element_type * GetResource (ItemIDType ID)
 Retrieves a resource specified by its ID from the resource manager. More...
 
PointerType ExtractResource (ItemIDType ID)
 Releases ownership of the owned resource with ID and returns it. More...
 
void RemoveResource (ItemIDType ID, const std::chrono::milliseconds Timeout=Util::ILockable::DefaultTimeout)
 Removes the resource identified by ID from the resource manager and deletes it. More...
 
void DeleteTreeWidgetItem (ItemIDType ID)
 Deletes the Resource::TreeWidgetItem of the requested resource. More...
 
void FocusTreeWidgetItem (ItemIDType ID)
 Selects the Resource::TreeWidgetItem of the requested resource. More...
 
template<typename T = PointerType, ShareResourceEnablerType< T > = 0>
auto ShareResource (ItemIDType ID) const
 Copies and returns the shared pointer pointing to (and owning) the resource identified by ID. The resource itself is neither copied nor changed. The const version of this method returns a shared pointer pointing to a const resource. This method is only available if the resources stored in the resource manager are managed by a shared pointer (i.e. PointerType is std::shared_ptr). More...
 
template<typename T = PointerType, ShareResourceEnablerType< T > = 0>
auto ShareResource (ItemIDType ID)
 Copies and returns the shared pointer pointing to (and owning) the resource identified by ID. The resource itself is neither copied nor changed. The const version of this method returns a shared pointer pointing to a const resource. This method is only available if the resources stored in the resource manager are managed by a shared pointer (i.e. PointerType is std::shared_ptr). More...
 
auto cbegin () const noexcept
 Returns an iterator to the first resource stored in the resource manager. More...
 
auto cend () const noexcept
 Returns an iterator behind the last resource stored in the resource manager. More...
 
template<typename ElementType >
ItemIDType InsertResource (ElementType &&Element)
 Inserts a resource into the resource manager. More...
 
template<typename DerivedType >
ItemIDListType Filter () const
 Builds and returns a list of the IDs of all resources stored in this resource manager which can be cast to DerivedType. More...
 
void Startup (FunctionToCallWhenObjectStartedType FunctionToCallWhenObjectStarted) const
 Starts all resources owned by the resource manager. For HardwareAdapterBase instances, Object::EnsureReadyState() is called. For InstrumentBase and ModuleBase instances, RunnableObject::RunIfRunOnCreation() is called. More...
 
void Shutdown () const
 Calls ShutdownChild() to terminate and clean up all resources stored in this resource manager. More...
 
void ClearResourcesWarnings () const
 Calls Object::ClearWarning() on all resources stored in this resource manager. More...
 
ItemIDListType GetFailedResourceIDs (bool OnlyResourcesBeingInUse=false) const
 Builds and returns a list of the IDs of all resources stored in this resource manager which are in an error state. More...
 
void ResetFailedResources () const
 Calls Object::Reset() on all resources stored in this resource manager which are in an error state (determined by Object::GetException()). More...
 
void PrepareReset ()
 Prepares all resources stored in this resource manager for their deletion by e.g. asking them to terminate. More...
 
void Reset ()
 Resets the resource manager by calling ResetChild(), by removing all resources from Map and by resetting CurrentID. All owned resources are deleted if they are not shared and still in use elsewhere. More...
 
QDomElement EntryConfigsToXML (QDomDocument &Document) const
 Creates and returns the XML tree containing the configuration of each resource owned by this resource manager for saving DynExp projects to XML files. The tree starts with a root node as produced by MakeXMLConfigHeadNode(). More...
 
void DeleteAllTreeWidgetItems ()
 Deletes the Resource::TreeWidgetItem of all resources stored in this resource manager. More...
 
template<typename LibraryVectorT >
void MakeEntriesFromXML (const QDomElement &XMLNode, const LibraryVectorT &Library, const DynExpCore &Core)
 Creates resources and takes ownership of them according to an XML tree from a DynExp project XML file. More...
 

Public Attributes

LinkBaseOnlyType LinkBaseOnly
 

Protected Member Functions

 ResourceManagerBase ()
 
 ~ResourceManagerBase ()=default
 
- Protected Member Functions inherited from DynExp::CommonResourceManagerBase
 CommonResourceManagerBase ()=default
 
 ~CommonResourceManagerBase ()=default
 

Private Types

template<typename T >
using ShareResourceEnablerType = std::enable_if_t< std::is_same_v< std::shared_ptr< typename T::element_type >, PointerType >, int >
 SFINAE alias to define methods assuming shared resource ownership only if PointerType is a std::shared_ptr pointing to a type T::element_type. More...
 
using MapType = std::unordered_map< ItemIDType, ResourceType >
 Type of a map mapping DynExp object IDs (ItemIDType) to DynExp resources (ResourceType) More...
 

Private Member Functions

auto LookUpResource (ItemIDType ID) const
 Retrieves a resource specified by its ID from the resource manager. More...
 
template<typename ElementType >
ItemIDType InsertResource (ElementType &&Element, const ItemIDType ID)
 Inserts a resource into the resource manager. More...
 
void RaiseID (const ItemIDType ConsumedID)
 If CurrentID is less or equal to ConsumedID, sets CurrentID to ConsumedID + 1. If CurrentID is greater than ConsumedID, does nothing. More...
 
void IncrementID ()
 Increments CurrentID. More...
 
Override

Override by derived classes.

virtual void StartupChild (FunctionToCallWhenObjectStartedType FunctionToCallWhenObjectStarted) const =0
 Starts all resources owned by the resource manager. For HardwareAdapterBase instances, Object::EnsureReadyState() is called. For InstrumentBase and ModuleBase instances, RunnableObject::RunIfRunOnCreation() is called. More...
 
virtual void ShutdownChild () const
 Calls ShutdownChild() to terminate and clean up all resources stored in this resource manager. More...
 
virtual void PrepareResetChild ()
 Prepares all resources stored in this resource manager for their deletion by e.g. asking them to terminate. More...
 
virtual void ResetChild ()
 Resets the resource manager by calling ResetChild(), by removing all resources from Map and by resetting CurrentID. All owned resources are deleted if they are not shared and still in use elsewhere. More...
 
virtual QDomElement MakeXMLConfigHeadNode (QDomDocument &Document) const =0
 Creates and returns the XML root node of the (single) resource manager instance of the derived manager type. Below this node in the XML hierarchy, each resource owned by this resource manager stores its configuration for saving DynExp projects to XML files. Also refer to EntryConfigsToXML(). More...
 

Private Attributes

MapType Map
 Map storing all resources owned by this resource manager. More...
 
ItemIDType CurrentID
 ID, the next resource added to the manager will receive. After initialization and reset (Reset()), the CurrentID will start with 1, so that 0 can have a special meaning (e.g. "resource not set"). More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from DynExp::CommonResourceManagerBase
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

template<typename PointerType>
class DynExp::ResourceManagerBase< PointerType >

Typed resource manager base class deriving from class CommonResourceManagerBase.

Template Parameters
PointerTypeType of the pointers pointing to the managed DynExp::Object instances

Definition at line 86 of file Managers.h.

Member Typedef Documentation

◆ MapType

template<typename PointerType >
using DynExp::ResourceManagerBase< PointerType >::MapType = std::unordered_map<ItemIDType, ResourceType>
private

Type of a map mapping DynExp object IDs (ItemIDType) to DynExp resources (ResourceType)

Definition at line 122 of file Managers.h.

◆ ResourceType

template<typename PointerType >
using DynExp::ResourceManagerBase< PointerType >::ResourceType = Resource<PointerType>

Type of the managed DynExp resources.

Definition at line 111 of file Managers.h.

◆ ShareResourceEnablerType

template<typename PointerType >
template<typename T >
using DynExp::ResourceManagerBase< PointerType >::ShareResourceEnablerType = std::enable_if_t<std::is_same_v<std::shared_ptr<typename T::element_type>, PointerType>, int>
private

SFINAE alias to define methods assuming shared resource ownership only if PointerType is a std::shared_ptr pointing to a type T::element_type.

Template Parameters
TPointer type with an alias element_type to perform the test with

Definition at line 120 of file Managers.h.

Constructor & Destructor Documentation

◆ ResourceManagerBase()

template<typename PointerType >
DynExp::ResourceManagerBase< PointerType >::ResourceManagerBase ( )
inlineprotected

Definition at line 125 of file Managers.h.

◆ ~ResourceManagerBase()

template<typename PointerType >
DynExp::ResourceManagerBase< PointerType >::~ResourceManagerBase ( )
protecteddefault

Member Function Documentation

◆ cbegin()

template<typename PointerType >
auto DynExp::ResourceManagerBase< PointerType >::cbegin ( ) const
inlinenoexcept

Returns an iterator to the first resource stored in the resource manager.

Returns
Returns a const iterator pointing to the beginning of Map.

Definition at line 220 of file Managers.h.

◆ cend()

template<typename PointerType >
auto DynExp::ResourceManagerBase< PointerType >::cend ( ) const
inlinenoexcept

Returns an iterator behind the last resource stored in the resource manager.

Returns
Returns a const iterator pointing to the end of Map.

Definition at line 226 of file Managers.h.

◆ ClearResourcesWarnings()

template<typename PointerType >
void DynExp::ResourceManagerBase< PointerType >::ClearResourcesWarnings

Calls Object::ClearWarning() on all resources stored in this resource manager.

Definition at line 487 of file Managers.h.

◆ DeleteAllTreeWidgetItems()

template<typename PointerType >
void DynExp::ResourceManagerBase< PointerType >::DeleteAllTreeWidgetItems

Deletes the Resource::TreeWidgetItem of all resources stored in this resource manager.

Definition at line 548 of file Managers.h.

◆ DeleteTreeWidgetItem()

template<typename PointerType >
void DynExp::ResourceManagerBase< PointerType >::DeleteTreeWidgetItem ( ItemIDType  ID)

Deletes the Resource::TreeWidgetItem of the requested resource.

Parameters
IDID of the resource whose Resource::TreeWidgetItem to delete.
Exceptions
Util::NotFoundExceptionis thrown if the resource manager does not own a resource with ID (resource not found in Map).

Definition at line 431 of file Managers.h.

◆ Empty()

template<typename PointerType >
const bool DynExp::ResourceManagerBase< PointerType >::Empty ( ) const
inlinenoexcept

Determines whether this resource manager is empty.

Returns
Returns true if Map is empty, false otherwise.

Definition at line 145 of file Managers.h.

◆ EntryConfigsToXML()

template<typename PointerType >
QDomElement DynExp::ResourceManagerBase< PointerType >::EntryConfigsToXML ( QDomDocument &  Document) const

Creates and returns the XML tree containing the configuration of each resource owned by this resource manager for saving DynExp projects to XML files. The tree starts with a root node as produced by MakeXMLConfigHeadNode().

Parameters
DocumentQt dom document within to create the dom element.
Returns
Qt dom element containing this resource manager's resources' configuration.

Definition at line 526 of file Managers.h.

◆ ExtractResource()

template<typename PointerType >
PointerType DynExp::ResourceManagerBase< PointerType >::ExtractResource ( ItemIDType  ID)

Releases ownership of the owned resource with ID and returns it.

Parameters
IDID of the resource to extract
Returns
Returns a pointer of type PointerType pointing to the extracted resource.
Exceptions
Util::NotFoundExceptionis thrown if the resource manager does not own a resource with ID (resource not found in Map).

Definition at line 406 of file Managers.h.

◆ Filter()

template<typename PointerType >
template<typename DerivedType >
ItemIDListType DynExp::ResourceManagerBase< PointerType >::Filter

Builds and returns a list of the IDs of all resources stored in this resource manager which can be cast to DerivedType.

Template Parameters
DerivedTypeType derived from DynExp::Object to filter the resources with
Returns
Returns a list (ItemIDListType) of the resource IDs belonging to owned resources which are of type DerivedType.

Definition at line 475 of file Managers.h.

◆ FocusTreeWidgetItem()

template<typename PointerType >
void DynExp::ResourceManagerBase< PointerType >::FocusTreeWidgetItem ( ItemIDType  ID)

Selects the Resource::TreeWidgetItem of the requested resource.

Parameters
IDID of the resource whose Resource::TreeWidgetItem to select.
Exceptions
Util::NotFoundExceptionis thrown if the resource manager does not own a resource with ID (resource not found in Map).

Definition at line 437 of file Managers.h.

◆ GetFailedResourceIDs()

template<typename PointerType >
ItemIDListType DynExp::ResourceManagerBase< PointerType >::GetFailedResourceIDs ( bool  OnlyResourcesBeingInUse = false) const

Builds and returns a list of the IDs of all resources stored in this resource manager which are in an error state.

Parameters
OnlyResourcesBeingInUseIf this argument is true, only resources are considered for which Object::IsUnused() returns false (i.e. resources which are used by other DynExp::Object instances). Otherwise, all owned resources are considered.
Returns
Returns a list (ItemIDListType) of the resource IDs belonging to owned resources which are in an error state (determined by Object::GetException()).

Definition at line 495 of file Managers.h.

◆ GetNextID()

template<typename PointerType >
ItemIDType DynExp::ResourceManagerBase< PointerType >::GetNextID ( ) const
inlinenoexcept

Getter for the ID to assign to the next resource to be inserted into the resource manager.

Returns
Returns CurrentID.

Definition at line 133 of file Managers.h.

◆ GetNumResources()

template<typename PointerType >
const auto DynExp::ResourceManagerBase< PointerType >::GetNumResources ( ) const
inlinenoexcept

Determines the amount of resources stored in this resource manager.

Returns
Returns the size of Map.

Definition at line 139 of file Managers.h.

◆ GetResource() [1/2]

template<typename PointerType >
PointerType::element_type * DynExp::ResourceManagerBase< PointerType >::GetResource ( ItemIDType  ID)

Retrieves a resource specified by its ID from the resource manager.

Parameters
IDID of the resource to return
Returns
Returns a pointer to the requested DynExp::Object.
Exceptions
Util::NotFoundExceptionis thrown if the resource manager does not own a resource with ID (resource not found in Map).

Definition at line 400 of file Managers.h.

◆ GetResource() [2/2]

template<typename PointerType >
const PointerType::element_type * DynExp::ResourceManagerBase< PointerType >::GetResource ( ItemIDType  ID) const

Retrieves a resource specified by its ID from the resource manager.

Parameters
IDID of the resource to return
Returns
Returns a pointer to the requested DynExp::Object.
Exceptions
Util::NotFoundExceptionis thrown if the resource manager does not own a resource with ID (resource not found in Map).

Definition at line 394 of file Managers.h.

◆ IncrementID()

template<typename PointerType >
void DynExp::ResourceManagerBase< PointerType >::IncrementID
private

Increments CurrentID.

Exceptions
Util::OverflowExceptionis thrown if CurrentID cannot be incremented without causing a numeric overflow.

Definition at line 618 of file Managers.h.

◆ InsertResource() [1/2]

template<typename PointerType >
template<typename ElementType >
ItemIDType DynExp::ResourceManagerBase< PointerType >::InsertResource ( ElementType &&  Element)

Inserts a resource into the resource manager.

Template Parameters
ElementTypeType of Element, which is perfectly forwarded to the constructor of ResourceType to create a DynExp resource to insert into the resource manager.
Parameters
ElementPointer to a DynExp object (e.g. DynExp::ModulePtrType).
IDID of the resource to insert
Returns
Returns ID.
Exceptions
Util::InvalidArgExceptionis thrown if ID is DynExp::ItemIDNotSet.
Util::InvalidStateExceptionis thrown if the resource manager owns already a resource with ID (resource already stored in Map).

Definition at line 468 of file Managers.h.

◆ InsertResource() [2/2]

template<typename PointerType >
template<typename ElementType >
ItemIDType DynExp::ResourceManagerBase< PointerType >::InsertResource ( ElementType &&  Element,
const ItemIDType  ID 
)
private

Inserts a resource into the resource manager.

Template Parameters
ElementTypeType of Element, which is perfectly forwarded to the constructor of ResourceType to create a DynExp resource to insert into the resource manager.
Parameters
ElementPointer to a DynExp object (e.g. DynExp::ModulePtrType).
IDID of the resource to insert
Returns
Returns ID.
Exceptions
Util::InvalidArgExceptionis thrown if ID is DynExp::ItemIDNotSet.
Util::InvalidStateExceptionis thrown if the resource manager owns already a resource with ID (resource already stored in Map).

Definition at line 591 of file Managers.h.

◆ LookUpResource()

template<typename PointerType >
auto DynExp::ResourceManagerBase< PointerType >::LookUpResource ( ItemIDType  ID) const
private

Retrieves a resource specified by its ID from the resource manager.

Parameters
IDID of the resource to return
Returns
Iterator of Map pointing to the DynExp resource with ID.
Exceptions
Util::NotFoundExceptionis thrown if the resource manager does not own a resource with ID (resource not found in Map).

Definition at line 579 of file Managers.h.

◆ MakeEntriesFromXML()

template<typename PointerType >
template<typename LibraryVectorT >
void DynExp::ResourceManagerBase< PointerType >::MakeEntriesFromXML ( const QDomElement &  XMLNode,
const LibraryVectorT &  Library,
const DynExpCore Core 
)

Creates resources and takes ownership of them according to an XML tree from a DynExp project XML file.

Template Parameters
LibraryVectorTType of the library containing the DynExp::Object types available to this resource manager (any of HardwareAdapterLibraryVectorType, InstrumentLibraryVectorType, or ModuleLibraryVectorType)
Parameters
XMLNodeXML root node of the (single) resource manager instance of the derived manager type.
LibraryLibrary to to create resources from
CoreReference to DynExp's core
Exceptions
Util::InvalidDataExceptionis thrown if the XML tree does not contain data in the expected format.

Definition at line 555 of file Managers.h.

◆ MakeXMLConfigHeadNode()

template<typename PointerType >
virtual QDomElement DynExp::ResourceManagerBase< PointerType >::MakeXMLConfigHeadNode ( QDomDocument &  Document) const
privatepure virtual

Creates and returns the XML root node of the (single) resource manager instance of the derived manager type. Below this node in the XML hierarchy, each resource owned by this resource manager stores its configuration for saving DynExp projects to XML files. Also refer to EntryConfigsToXML().

Parameters
DocumentQt dom document within to create the dom element.
Returns
Qt dom element acting as the root node of this resource manager's resources' configuration.

Implemented in DynExp::ModuleManager, DynExp::InstrumentManager, and DynExp::HardwareAdapterManager.

◆ PrepareReset()

template<typename PointerType >
void DynExp::ResourceManagerBase< PointerType >::PrepareReset ( )
inline

Prepares all resources stored in this resource manager for their deletion by e.g. asking them to terminate.

Definition at line 283 of file Managers.h.

◆ PrepareResetChild()

template<typename PointerType >
virtual void DynExp::ResourceManagerBase< PointerType >::PrepareResetChild ( )
inlineprivatevirtual

Prepares all resources stored in this resource manager for their deletion by e.g. asking them to terminate.

Reimplemented in DynExp::ModuleManager, and DynExp::InstrumentManager.

Definition at line 369 of file Managers.h.

◆ RaiseID()

template<typename PointerType >
void DynExp::ResourceManagerBase< PointerType >::RaiseID ( const ItemIDType  ConsumedID)
private

If CurrentID is less or equal to ConsumedID, sets CurrentID to ConsumedID + 1. If CurrentID is greater than ConsumedID, does nothing.

Parameters
ConsumedIDResource ID which has been consumed by inserting a resource with this ID into the resource manager.

Definition at line 608 of file Managers.h.

◆ RemoveResource()

template<typename PointerType >
void DynExp::ResourceManagerBase< PointerType >::RemoveResource ( ItemIDType  ID,
const std::chrono::milliseconds  Timeout = Util::ILockable::DefaultTimeout 
)

Removes the resource identified by ID from the resource manager and deletes it.

Parameters
IDID of the resource to remove
Timeout
Exceptions
Util::NotFoundExceptionis thrown if the resource manager does not own a resource with ID (resource not found in Map).

Definition at line 418 of file Managers.h.

◆ Reset()

template<typename PointerType >
void DynExp::ResourceManagerBase< PointerType >::Reset

Resets the resource manager by calling ResetChild(), by removing all resources from Map and by resetting CurrentID. All owned resources are deleted if they are not shared and still in use elsewhere.

Definition at line 517 of file Managers.h.

◆ ResetChild()

template<typename PointerType >
virtual void DynExp::ResourceManagerBase< PointerType >::ResetChild ( )
inlineprivatevirtual

Resets the resource manager by calling ResetChild(), by removing all resources from Map and by resetting CurrentID. All owned resources are deleted if they are not shared and still in use elsewhere.

Definition at line 370 of file Managers.h.

◆ ResetFailedResources()

template<typename PointerType >
void DynExp::ResourceManagerBase< PointerType >::ResetFailedResources

Calls Object::Reset() on all resources stored in this resource manager which are in an error state (determined by Object::GetException()).

Definition at line 508 of file Managers.h.

◆ ShareResource() [1/2]

template<typename PointerType >
template<typename T , ResourceManagerBase< PointerType >::ShareResourceEnablerType< T > >
auto DynExp::ResourceManagerBase< PointerType >::ShareResource ( ItemIDType  ID)

Copies and returns the shared pointer pointing to (and owning) the resource identified by ID. The resource itself is neither copied nor changed. The const version of this method returns a shared pointer pointing to a const resource. This method is only available if the resources stored in the resource manager are managed by a shared pointer (i.e. PointerType is std::shared_ptr).

Template Parameters
TSet to PointerType. Do not pass anything.
Parameters
IDID of the resource to share
Returns
Returns Resource::ResourcePointer of the requested resource.
Exceptions
Util::NotFoundExceptionis thrown if the resource manager does not own a resource with ID (resource not found in Map).

Definition at line 461 of file Managers.h.

◆ ShareResource() [2/2]

template<typename PointerType >
template<typename T , ResourceManagerBase< PointerType >::ShareResourceEnablerType< T > >
auto DynExp::ResourceManagerBase< PointerType >::ShareResource ( ItemIDType  ID) const

Copies and returns the shared pointer pointing to (and owning) the resource identified by ID. The resource itself is neither copied nor changed. The const version of this method returns a shared pointer pointing to a const resource. This method is only available if the resources stored in the resource manager are managed by a shared pointer (i.e. PointerType is std::shared_ptr).

Template Parameters
TSet to PointerType. Do not pass anything.
Parameters
IDID of the resource to share
Returns
Returns Resource::ResourcePointer of the requested resource.
Exceptions
Util::NotFoundExceptionis thrown if the resource manager does not own a resource with ID (resource not found in Map).

Definition at line 454 of file Managers.h.

◆ Shutdown()

template<typename PointerType >
void DynExp::ResourceManagerBase< PointerType >::Shutdown ( ) const
inline

Calls ShutdownChild() to terminate and clean up all resources stored in this resource manager.

Definition at line 255 of file Managers.h.

◆ ShutdownChild()

template<typename PointerType >
virtual void DynExp::ResourceManagerBase< PointerType >::ShutdownChild ( ) const
inlineprivatevirtual

Calls ShutdownChild() to terminate and clean up all resources stored in this resource manager.

Reimplemented in DynExp::ModuleManager, and DynExp::InstrumentManager.

Definition at line 368 of file Managers.h.

◆ Startup()

template<typename PointerType >
void DynExp::ResourceManagerBase< PointerType >::Startup ( FunctionToCallWhenObjectStartedType  FunctionToCallWhenObjectStarted) const
inline

Starts all resources owned by the resource manager. For HardwareAdapterBase instances, Object::EnsureReadyState() is called. For InstrumentBase and ModuleBase instances, RunnableObject::RunIfRunOnCreation() is called.

Parameters
FunctionToCallWhenObjectStartedCallback function. Refer to FunctionToCallWhenObjectStartedType.

Definition at line 250 of file Managers.h.

◆ StartupChild()

template<typename PointerType >
virtual void DynExp::ResourceManagerBase< PointerType >::StartupChild ( FunctionToCallWhenObjectStartedType  FunctionToCallWhenObjectStarted) const
privatepure virtual

Starts all resources owned by the resource manager. For HardwareAdapterBase instances, Object::EnsureReadyState() is called. For InstrumentBase and ModuleBase instances, RunnableObject::RunIfRunOnCreation() is called.

Parameters
FunctionToCallWhenObjectStartedCallback function. Refer to FunctionToCallWhenObjectStartedType.

Implemented in DynExp::ModuleManager, DynExp::InstrumentManager, and DynExp::HardwareAdapterManager.

Member Data Documentation

◆ CurrentID

template<typename PointerType >
ItemIDType DynExp::ResourceManagerBase< PointerType >::CurrentID
private

ID, the next resource added to the manager will receive. After initialization and reset (Reset()), the CurrentID will start with 1, so that 0 can have a special meaning (e.g. "resource not set").

Definition at line 390 of file Managers.h.

◆ LinkBaseOnly

template<typename PointerType >
LinkBaseOnlyType DynExp::ResourceManagerBase< PointerType >::LinkBaseOnly

Definition at line 322 of file Managers.h.

◆ Map

template<typename PointerType >
MapType DynExp::ResourceManagerBase< PointerType >::Map
private

Map storing all resources owned by this resource manager.

Definition at line 383 of file Managers.h.


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