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

Library type that holds factory functions to all available inter-module events. More...

#include <Module.h>

Public Types

using EventFactoryFuncPtrType = std::function< InterModuleEventBase::InterModuleEventPtrType(void)>
 Type of a function pointer pointing to a factory function to create an instance of an inter-module event derived from InterModuleEventBase.
 

Public Member Functions

void Register (size_t ID, EventFactoryFuncPtrType EventFactoryFuncPtr)
 Adds an inter-module event derived from InterModuleEventBase to this library.
 
auto & GetEvents () const noexcept
 Getter for Events.
 

Static Public Member Functions

static InterModuleEventLibraryGet ()
 Getter for the singleton instance of InterModuleEventLibrary.
 

Private Member Functions

 InterModuleEventLibrary ()=default
 Constructs an instance of InterModuleEventLibrary. Private to make singleton class.
 

Private Attributes

std::map< size_t, EventFactoryFuncPtrTypeEvents
 Maps the unique ID of inter-module events derived from InterModuleEventBase to their respective factory function.
 

Detailed Description

Library type that holds factory functions to all available inter-module events.

Definition at line 1323 of file Module.h.

Member Typedef Documentation

◆ EventFactoryFuncPtrType

Type of a function pointer pointing to a factory function to create an instance of an inter-module event derived from InterModuleEventBase.

Definition at line 1330 of file Module.h.

Constructor & Destructor Documentation

◆ InterModuleEventLibrary()

DynExp::InterModuleEventLibrary::InterModuleEventLibrary ( )
privatedefault

Constructs an instance of InterModuleEventLibrary. Private to make singleton class.

Member Function Documentation

◆ Get()

InterModuleEventLibrary & DynExp::InterModuleEventLibrary::Get ( )
static

Getter for the singleton instance of InterModuleEventLibrary.

Returns
Returns the single instance of InterModuleEventLibrary.

Definition at line 432 of file Module.cpp.

◆ GetEvents()

auto & DynExp::InterModuleEventLibrary::GetEvents ( ) const
inlinenoexcept

Getter for Events.

Returns
Returns Events.

Definition at line 1349 of file Module.h.

◆ Register()

void DynExp::InterModuleEventLibrary::Register ( size_t  ID,
EventFactoryFuncPtrType  EventFactoryFuncPtr 
)
inline

Adds an inter-module event derived from InterModuleEventBase to this library.

Parameters
IDUniqe ID of the event derived from InterModuleEventBase.
EventFactoryFuncPtrFactory function of the event derived from InterModuleEventBase.

Definition at line 1343 of file Module.h.

Member Data Documentation

◆ Events

std::map<size_t, EventFactoryFuncPtrType> DynExp::InterModuleEventLibrary::Events
private

Maps the unique ID of inter-module events derived from InterModuleEventBase to their respective factory function.

Definition at line 1361 of file Module.h.


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