DynExp
Highly flexible laboratory automation for dynamically changing experiments.
DynExp Namespace Reference

DynExp's main namespace contains the implementation of DynExp including classes to manage resources (DynExp objects like hardware adapters, instruments, and modules) as well as their dependencies and parameters. More...

Classes

class  ProjectParams
 Defines a parameter class with parameters common to all DynExp projects. More...
 
class  DynExpCore
 DynExp's core class acts as the interface between the user interface and DynExp's internal data like all DynExp::Object instances and their threads. There should only be one instance of this class. It owns all DynExp resources through the respective ResourceManagerBase instances. Logical const-ness: Non-const functions (like functions to run/stop/reset/save/... the project) cannot be called from DynExp::Object instances possessing a const handle to the DynExpCore instance. Instead, these functions should be called through the user interface (from the DynExpManager instance). More...
 
struct  DefaultLocaleSeparator
 Default number separators used within DynExp. More...
 
class  HardwareAdapterParamsBase
 Parameter class for HardwareAdapterBase. More...
 
class  HardwareAdapterConfiguratorBase
 Configurator class for HardwareAdapterBase. More...
 
class  HardwareAdapterBase
 Defines the base class for a hardware adapter object. Hardware adapters describe interfaces/connections to physical hardware. More...
 
class  SerialCommunicationException
 Defines an exception caused by a serial communication operation of a hardware adapter. More...
 
class  SerialCommunicationHardwareAdapterParams
 Parameter class for SerialCommunicationHardwareAdapter. More...
 
class  SerialCommunicationHardwareAdapterConfigurator
 Configurator class for SerialCommunicationHardwareAdapter. More...
 
class  SerialCommunicationHardwareAdapter
 Defines a hardware adapter for serial communication. Logical const-ness: see declaration of class DynExp::Object. More...
 
class  QSerialCommunicationHardwareAdapterParams
 Parameter class for QSerialCommunicationHardwareAdapter. More...
 
class  QSerialCommunicationHardwareAdapterConfigurator
 Configurator class for QSerialCommunicationHardwareAdapter. More...
 
class  QSerialCommunicationHardwareAdapterWorker
 Qt worker which performs actual serial communication hardware operations in a separate thread in order not to interfer with processor time used to update the user interface. All functions are inherently thead-safe since they are only called by the worker thread the respective instance of this class lives in. More...
 
class  QSerialCommunicationHardwareAdapter
 SerialCommunicationHardwareAdapter is based on a Qt communication object (wrapped by QSerialCommunicationHardwareAdapterWorker) which cannot be shared between different threads. Instead, it lives in a DynExpCore's worker thread. QSerialCommunicationHardwareAdapter just pushes messages to it and allows the QSerialCommunicationHardwareAdapterWorker instance to communicate its state and data to the corresponding QSerialCommunicationHardwareAdapter instance. More...
 
class  NetworkException
 Defines an exception caused by a hardware operation on an ethernet interface (e.g. reading/writing data to a TCP socket). More...
 
class  NetworkParamsExtension
 Bundles several parameters to describe a network connection. Use in parameter classes. More...
 
class  HardwareAdapterTcpSocketParams
 Parameter class for HardwareAdapterTcpSocket. More...
 
class  HardwareAdapterTcpSocketConfigurator
 Configurator class for HardwareAdapterTcpSocket. More...
 
class  HardwareAdapterTcpSocketWorker
 Qt worker for network communication in a separate thread. More...
 
class  HardwareAdapterTcpSocket
 Implements a hardware adapter to communicate with text-based commands over TCP sockets. More...
 
class  SerialPortException
 Defines an exception caused by a hardware operation on a COM port (e.g. reading/writing data to a COM port). More...
 
class  HardwareAdapterSerialPortParams
 Parameter class for HardwareAdapterSerialPort. More...
 
class  HardwareAdapterSerialPortConfigurator
 Configurator class for HardwareAdapterSerialPort. More...
 
class  HardwareAdapterSerialPortWorker
 Qt worker for serial/COM port communication in a separate thread. More...
 
class  HardwareAdapterSerialPort
 Implements a hardware adapter to communicate with text-based commands over COM ports. More...
 
class  ExceptionContainer
 Wrapper holding a pointer to an exception and providing functionality for accessing it. Used to transfer exceptions between an instrument's task and the ModuleBase module enqueuing the task. Refer to TaskBase::CallbackType. More...
 
class  InstrumentDataBase
 Data structure to contain data which is synchronized in between different threads. This is needed since the instrument thread, the threads of different modules, as well as the main thread might access the instrument at the same time. Every class (indirectly) derived from class InstrumentBase must be accompanied by a instrument data class derived from InstrumentDataBase. InstrumentDataBase and derived classes contain data shared by the respective instrument, module and main threads. Data only used by the instrument itself should be private members of the instrument class. More...
 
class  InstrumentParamsBase
 Parameter class for InstrumentBase. More...
 
class  InstrumentConfiguratorBase
 Configurator class for InstrumentBase. More...
 
class  InstrumentBase
 Base class for instruments. Instruments comprise virtual devices (meta instruments) and physial devices (instruments). While meta instruments are used by modules (ModuleBase) as an abstraction layer, physical instruments derive from meta instruments and make usually use of one hardware adapter (HardwareAdapterBase) to communicate with the underlying hardware. More...
 
class  InstrumentInstance
 Defines data for a thread belonging to a InstrumentBase instance. Refer to RunnableInstance. More...
 
class  TaskResultType
 Defines the return type of task functions. More...
 
class  TaskBase
 Base class for all tasks being processed by instruments. The class must not contain public virtual functions since TaskBase::CallbackFunc could call them in TaskBase's destructor. More...
 
class  DefaultTask
 Default task which does not do anything. Though, calling it ensures that TaskBase::CallbackFunc gets called. This is required to avoid InstrumentBase::AsSyncTask() getting stuck in an infinite loop. All functions overridden from meta instruments, which are expected to enqueue a task, must at least enqueue a DefaultTask (by calling MakeAndEnqueueTask< DynExp::DefaultTask >(CallbackFunc);) More...
 
class  InitTaskBase
 Defines a task for initializing an instrument within an instrument inheritance hierarchy. Each instrument (indirectly) derived from class InstrumentBase must be accompanied by an initialization task class derived from InitTaskBase. Even if the task does not do anything, at least it has to call InitTaskBase::InitFuncImpl() of the derived instrument's initialization task class. More...
 
class  ExitTaskBase
 Defines a task for deinitializing an instrument within an instrument inheritance hierarchy. Each instrument (indirectly) derived from class InstrumentBase must be accompanied by a deinitialization task class derived from ExitTaskBase. Even if the task does not do anything, at least it has to call ExitTaskBase::ExitFuncImpl() of the derived instrument's deinitialization task class. More...
 
class  UpdateTaskBase
 Defines a task for updating an instrument within an instrument inheritance hierarchy. Each instrument (indirectly) derived from class InstrumentBase must be accompanied by an update task class derived from UpdateTaskBase. Even if the task does not do anything, at least it has to call UpdateTaskBase::UpdateFuncImpl() of the derived instrument's update task class. More...
 
class  ArriveAtLatchTask
 Defines a task which arrives at a std::latch when it is executed. This is useful to synchronize multiple instruments and make their execution block until a set of instruments has arrived at the latch. Refer to InstrumentBase::EnqueueArriveAtLatchTask() and to WaitForInstruments(). More...
 
class  LibraryObjectFactoryParamList
 Type consisting of function pointer types instantiating DynExp objects. Refer to DynExp::LibraryObjectFactoryPtrType. More...
 
class  LibraryConfigFactoryParamList
 Type consisting of function pointer types returning configurators for DynExp objects. Refer to DynExp::ConfiguratorBasePtrType. More...
 
class  LibraryStringParamList
 Type consisting of function pointer types returning string literals. Refer to DynExp::LibraryStringParamPtrType. More...
 
struct  LibraryEntry
 Represents an entry in the library. More...
 
class  LibraryBase
 Represents the base class for a library containing library entries (DynExp::LibraryEntry). More...
 
class  LibraryBase< ObjectTypeBasePtr, LibraryObjectFactoryParamList< ObjectTypeBasePtr, ObjFactories... >, LibraryConfigFactoryParamList< ConfFactories... >, LibraryStringParamList< NameFuncs... >, LibraryStringParamList< CategoryFuncs... > >
 Represents the specialized base class for a library containing library entries (DynExp::LibraryEntry). More...
 
class  HardwareAdapterLibrary
 Represents a hardware adapter library to generate instances of classes derived from DynExp::HardwareAdapterBase. More...
 
class  InstrumentLibrary
 Represents an instrument library to generate instances of classes derived from DynExp::InstrumentBase. More...
 
class  ModuleLibrary
 Represents a module library to generate instances of classes derived from DynExp::ModuleBase. More...
 
struct  Resource
 Defines a DynExp resource, which mainly owns a DynExp::Object instance wrapping a pointer to it. More...
 
class  CommonResourceManagerBase
 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...
 
class  ResourceManagerBase
 Typed resource manager base class deriving from class CommonResourceManagerBase. More...
 
class  HardwareAdapterManager
 Resource manager for HardwareAdapterBase resources deriving from a specialized ResourceManagerBase class. More...
 
class  InstrumentManager
 Resource manager for InstrumentBase resources deriving from a specialized ResourceManagerBase class. More...
 
class  ModuleManager
 Resource manager for ModuleBase resources deriving from a specialized ResourceManagerBase class. More...
 
class  EventBase
 Common base class for all events to store them in a FIFO queue to be invoked later. More...
 
class  DefaultEvent
 Describes an event which consists of a receiver's member function and a set of arguments to call this function with. The first argument is expected to be of type ModuleInstance*. This argument is not included in ArgTupleType). More...
 
class  ModuleDataBase
 Data structure to contain data which is synchronized in between different threads. This is needed since the module thread as well as the main thread might access the module at the same time. Every class (indirectly) derived from class ModuleBase must be accompanied by a module data class derived from ModuleDataBase. ModuleDataBase and derived classes contain data shared by the respective module thread and the user interface (main) thread to e.g. visualize data. Data only used by the module thread should be private members of the module class. Data only used by the user interface should be private members of the module's widget class (derived from QModuleWidget), respectively. More...
 
class  ModuleParamsBase
 Parameter class for ModuleBase. More...
 
class  ModuleConfiguratorBase
 Configurator class for ModuleBase. More...
 
class  ModuleBase
 Base class for modules. Modules implement programs on their own (e.g. measurement protocols or servers for ethernet communication). They might have a user interface. Modules make use of meta instruments (InstrumentBase) to implement e.g. measurement routines on a higher level, which renders the modules independent from physical devices from specific manufacturers. Derive from this class to implement modules without a user interface. More...
 
class  ModuleInstance
 Defines data for a thread belonging to a ModuleBase instance. Refer to RunnableInstance. More...
 
class  EventListenersBase
 Common base class for all managers of event listeners of type TypedEventListeners. ModuleBase instances are considered event listeners. More...
 
class  TypedEventListeners
 Typed managers of event listeners class whose instances are owned by classes derived from InterModuleEvent. The class maps modules registering/subscribing to inter-module events to the respective event functions which are invoked when the related event occurs. More...
 
class  InterModuleEventBase
 Common base class for all inter-module events. More...
 
class  InterModuleEvent
 Typed base class for inter-module events to realize CRTP. More...
 
class  QModuleWidget
 Window class for Qt-based user interfaces belonging to DynExp modules. User interface Qt window classes belonging to a module derived from ModuleBase have to derive from this class. More...
 
class  QModuleDockWidget
 Provides a frame for QModuleWidget windows, which are undocked from the DynExpManager's QMdiArea. More...
 
class  QModuleDataBase
 Data class for QModuleBase. More...
 
class  WindowStyleParamsExtension
 Bundles several parameters to describe a UI window's style. Use in parameter classes. More...
 
class  QModuleParamsBase
 Parameter class for QModuleBase. More...
 
class  QModuleConfiguratorBase
 Configurator class for QModuleBase. More...
 
class  QModuleBase
 Base class for modules with a Qt-based user interface. Derive from this class to implement modules with a user interface. More...
 
class  ObjectLink
 Type to define object link parameters as ParamsBase::Param< ObjectLink< ObjectT > > or to define object link list parameters as ParamsBase::ListParam< ObjectLink< ObjectT > >. Such parameters own (one or multiple) ObjectLink instances and assign a resource to each instance. ObjectLink instances hold a std::weak_ptr to the resource and lock this weak_ptr if requested returning a respective LinkedObjectWrapper instance. A new resource can be assigned to an ObjectLink instance while LinkedObjectWrapper(s) exist since they hold an independent shared_ptr to the resource they have been created from. ObjectLink does not need to be thread-safe itself. All operations on it are performed through the respective ParamsBase::Param or ParamsBase::ListParam instance. To operate on those instances, the ParamsBase instance owning the respective parameter needs to be locked which renders ObjectLink implicitely thread-safe. More...
 
struct  ManagerTypeOfObjectType
 Type trait relating a type ObjectType derived from either class HardwareAdapterBase or class InstrumentBase to the resource manager type (derived from DynExp::CommonResourceManagerBase) managing instances of the type ObjectType. More...
 
class  ObjectUserList
 Helper class to enable keeping track of instances of class Object making use of the owner of the respective ObjectUserList's instance. Instances of class Object can register or deregister multiple times as an user which increments or decrements their respective registration count in ObjectUserList::UserList. More...
 
class  LinkBase
 Abstract base class of link parameters (to be saved in project files) describing relations between multiple Object (e.g. a module making use of an instrument). More...
 
class  ParamsBase
 Abstract base class for object parameter classes. Each class derived from class Object must be accompanied by a parameter class derived from ParamsBase. These parameter classes are intended to contain the object's parameters (sub-classes of ParamsBase::ParamBase) which are stored in DynExp project files and which can be configured in the respective object instance's settings dialog or programmatically. Parameter classes are synchronized in between different threads (e.g. the main thread and an instrument/module thread). More...
 
class  ConfiguratorBase
 The configurator classes have the task to generate parameter objects (refer to DynExp::ParamsBase) of the corresponding type for DynExp objects DynExp::Object. For each class derived from DynExp::Object, there must be a respective configurator derived from ConfiguratorBase. More...
 
class  Object
 Base class for all DynExp Objects like hardware adapters (DynExp::HardwareAdapterBase), instruments (DynExp::InstrumentBase) and modules (DynExp::ModuleBase). Subclasses should also derive either form Util::INonCopyable or Util::ILockable since Object is not intended to be copied. Especially, it must not be moved to another thread (than the one creating it). Logical const-ness: const member functions can be called by other threads, non-const functions are visible only to main thread. More...
 
class  RunnableObjectParams
 Parameter class for RunnableObject. More...
 
class  RunnableObjectConfigurator
 Configurator class for RunnableObject. More...
 
class  RunnableObject
 Defines an Object which possesses a thread it runs in. The RunnableObject can be started and stopped as well as paused and resumed. More...
 
class  LinkedObjectWrapperBase
 Polymorphic base class to allow storing LinkedObjectWrapper of any type in a single list. More...
 
class  LinkedObjectWrapper
 Holds a shared_ptr to a resource (instance of class Object) and lets the resource keep track of its usage count by increasing a respective counter of the resource on construction and by decreasing the counter on destruction of the LinkedObjectWrapper instance again. Not copyable in order not to mess up the usage counter stored in LinkedObjectWrapper::DestinyResource. Only accessed via a thread's instance of class RunnableInstance in that thread. Also refer to RunnableInstance. More...
 
class  LinkedObjectWrapperPointer
 This class describes a pointer to a LinkedObjectWrapper instance. It is a simple wrapper class which only adds specific behavior like always returning a const pointer to a LinkedObjectWrapper instance wrapping a const Object instance. More...
 
class  LinkedObjectWrapperContainerBase
 Polymorphic base class to allow storing LinkedObjectWrapperContainer of any type in a single list. More...
 
class  LinkedObjectWrapperContainer
 This class holds a pointer (LinkedObjectWrapperPointer) to a LinkedObjectWrapper. Intances of this class should be owned by classes derived from class InstrumentDataBase or class ModuleDataBase. These instances provide access to objects referenced by object link parameters. LinkedObjectWrapperContainer does not own the referenced LinkedObjectWrapper. The LinkedObjectWrapper itself is owned by class RunnableInstance. The pointer hold here is also set and managed by class RunnableInstance. Also refer to class RunnableInstance. More...
 
class  LinkedObjectWrapperContainerList
 This class defines a list of LinkedObjectWrapperContainer instances. The list owns the contained LinkedObjectWrapperContainer instances. Intances of this class should be owned by classes derived from class InstrumentDataBase or class ModuleDataBase. These instances provide access to objects referenced by object link list parameters (ListParam). The list's entries are exclusively managed by the respective instance of class RunnableInstance. RunnableInstance stores references to list entries. Every list manipulation RunnableInstance is not aware of might cause dangling references! More...
 
class  ObjectLinkBase
 Base class for object link parameter types to allow SFINAE in ParamsBase::Param for ObjectLink of any type. More...
 
class  RunnableInstance
 Defines data for a thread belonging to a RunnableObject instance. This data is only accessed by the RunnableObject instance's thread. So, no synchronization mechanism is needed. Furthermore, this class is designed to exist only on the stack. RunnableInstance instances are to be passed as a parameter to the respective thread functions. This ensures that a RunnableInstance instances is deleted when its thread function returns. This class is responsible for locking an object link (list) parameter (ParamsBase::Param< ObjectLink< ObjectT > > or ParamsBase::ListParam< ObjectLink< ObjectT > >) hold by a class derived (indirectly) from class ParamsBase and for storing the locked resource in a LinkedObjectWrapper instance. In turn, the created LinkedObjectWrapper instance is stored in a LinkedObjectWrapperContainer instance hold by a class derived (indirectly) from InstrumentDataBase or from ModuleDataBase. Furthermore, this class is responsible for unlocking LinkedObjectWrapper instances it created. Unlocking is triggered either on request or on destruction of the RunnableInstance instance owning the LinkedObjectWrapper instance. More...
 

Typedefs

using ItemIDType = size_t
 ID type of objects/items managed by DynExp. More...
 
using HardwareAdapterPtrType = std::shared_ptr< HardwareAdapterBase >
 Pointer type to store a hardware adapter (DynExp::HardwareAdapterBase) with. More...
 
using InstrumentPtrType = std::shared_ptr< InstrumentBase >
 Pointer type to store an instrument (DynExp::InstrumentBase) with. More...
 
template<typename ObjectTypeBasePtr >
using LibraryObjectFactoryPtrType = ObjectTypeBasePtr(*)(const std::thread::id, ParamsBasePtrType &&)
 Alias for a factory function pointer type that instantiates library entries to create DynExp objects derived from DynExp::Object. As arguments, it expects the thread ID of the thread owning the resource and a reference to the resource's parameters to take ownership of. Compatible e.g. to DynExp::MakeModule(). More...
 
using LibraryConfigFactoryPtrType = ConfiguratorBasePtrType(*)()
 Alias for a factory function pointer type that creates a configurator for a specific library entry. Compatible e.g. to DynExp::MakeModuleConfig(). More...
 
using LibraryStringType = const char *
 String type used for library entry descriptors. More...
 
using LibraryStringParamPtrType = LibraryStringType(*)()
 Pointer to a DynExp object's static constexpr function returning a string literal. Used for the Name() and Category() functions which are required for classes derived from DynExp::Object to become library entries. More...
 
using HardwareAdapterLibraryVectorType = std::vector< LibraryEntry< HardwareAdapterPtrType > >
 Alias for the vector type containing entries of a hardware adapter library. More...
 
using InstrumentLibraryVectorType = std::vector< LibraryEntry< InstrumentPtrType > >
 Alias for the vector type containing entries of a instrument library. More...
 
using ModuleLibraryVectorType = std::vector< LibraryEntry< ModulePtrType > >
 Alias for the vector type containing entries of a module library. More...
 
using ModulePtrType = std::unique_ptr< ModuleBase >
 Pointer type to store a module (DynExp::ModuleBase) with. More...
 
using ItemIDListType = std::vector< ItemIDType >
 Type of a list of IDs belonging to objects managed by DynExp. More...
 
template<typename ObjectType >
using ManagerTypeOfObjectType_t = typename ManagerTypeOfObjectType< ObjectType >::type
 Alias for a resource manager type (derived from DynExp::CommonResourceManagerBase) managing resources of type ObjectType. More...
 
using ParamsBasePtrType = std::unique_ptr< ParamsBase >
 Alias for a pointer to the parameter system base class ParamsBase. More...
 
using ConfiguratorBasePtrType = std::shared_ptr< ConfiguratorBase >
 Alias for a pointer to the configurator base class ConfiguratorBase. More...
 

Enumerations

enum  : ItemIDType { ItemIDNotSet = 0 }
 ID of an non-existent object/item. More...
 
enum class  TextUsageType { Standard , Path , Code }
 Specifies the usage of a text-type parameter. Setting the right usage allows the ParamsConfigDialog to add specific functionality to a text field to edit the parameter's value. More...
 

Functions

template<typename HardwareAdapterT >
ConfiguratorBasePtrType MakeHardwareAdapterConfig ()
 Factory function to generate a configurator for a specific hardware adapter type. More...
 
template<typename HardwareAdapterT >
HardwareAdapterPtrType MakeHardwareAdapter (const std::thread::id OwnerThreadID, ParamsBasePtrType &&Params)
 Factory function to generate a hardware adapter of a specific type. More...
 
int InstrumentThreadMain (InstrumentInstance Instance, InstrumentBase *const Instrument)
 Instruments run in their own thread. This is the instrument thread's main function. More...
 
template<typename InstrumentT >
ConfiguratorBasePtrType MakeInstrumentConfig ()
 Factory function to generate a configurator for a specific instrument type. More...
 
template<typename InstrumentT >
InstrumentPtrType MakeInstrument (const std::thread::id OwnerThreadID, ParamsBasePtrType &&Params)
 Factory function to generate an instrument of a specific type. More...
 
template<typename TaskT , typename... ArgTs>
std::unique_ptr< TaskT > MakeTask (ArgTs &&...Args)
 Factory function to create a task to be enqueued in an instrument's task queue. More...
 
template<typename To , typename From , std::enable_if_t< std::is_same_v< InstrumentDataBase, std::remove_cv_t< From >>, int > = 0>
auto dynamic_InstrumentData_cast (Util::SynchronizedPointer< From > &&InstrumentDataPtr)
 Casts the data base class From into a derived InstrumentBase's (To) data class keeping the data locked by Util::SynchronizedPointer for thread-safe casting. More...
 
template<typename... InstrTs>
void WaitForInstruments (InstrTs &... Instruments)
 Blocks until every instrument passed to the function as a reference parameter has arrived at a synchronization point. More...
 
template<typename LibraryVectorT >
const LibraryVectorT::value_type & FindInLibraryVector (const LibraryVectorT &LibraryVector, const std::string &Category, const std::string &Name)
 Finds an entry in a library vector by category and name. More...
 
int ModuleThreadMain (ModuleInstance Instance, ModuleBase *const Module)
 Modules run in their own thread. This is the module thread's main function. More...
 
template<typename ModuleT >
ConfiguratorBasePtrType MakeModuleConfig ()
 Factory function to generate a configurator for a specific module type. More...
 
template<typename ModuleT >
ModulePtrType MakeModule (const std::thread::id OwnerThreadID, ParamsBasePtrType &&Params)
 Factory function to generate a module of a specific type. More...
 
template<typename ReceiverType , typename... ArgsTs>
auto MakeEvent (ReceiverType *Receiver, typename DefaultEvent< ReceiverType, std::tuple< std::remove_reference_t< ArgsTs >... >>::EventFuncPtrType EventFuncPtr, ArgsTs &&...Args)
 Creates an event of type DefaultEvent. More...
 
template<typename To , typename From , std::enable_if_t< std::is_same_v< ModuleDataBase, std::remove_cv_t< From >>, int > = 0>
auto dynamic_ModuleData_cast (Util::SynchronizedPointer< From > &&ModuleDataPtr)
 Casts the data base class From into a derived ModuleBase's (To) data class keeping the data locked by Util::SynchronizedPointer for thread-safe casting. More...
 
template<typename ParamType >
auto operator== (const ParamsBase::TypedParamBase< ParamType > &lhs, const ParamType &rhs)
 Provides (in)equality comparison operators for two parameters. Since C++20, inequality operators (operator!=) are generated by compiler. More...
 
template<typename ParamType >
auto operator<=> (const ParamsBase::TypedParamBase< ParamType > &lhs, const ParamType &rhs)
 Provides three-way comparison for two parameters. More...
 
template<typename ConfiguratorT >
ParamsBasePtrType MakeParams (ItemIDType ID, const DynExpCore &Core)
 Factory function to generate an Object's parameters. More...
 
template<typename T >
T::ParamsType * dynamic_Params_cast (ParamsBasePtrType::element_type *Params)
 Casts the parameter base class to a derived Object's parameter class. More...
 
template<typename To , typename From , std::enable_if_t< std::is_same_v< ParamsBase, std::remove_cv_t< From >>, int > = 0>
auto dynamic_Params_cast (Util::SynchronizedPointer< From > &&ParamsPtr)
 Casts the parameter base class From to a derived Object's (To) parameter class keeping the parameters locked by Util::SynchronizedPointer for thread-safe casting. More...
 
template<typename To , typename From , std::enable_if_t< std::is_base_of_v< Object, To > &&std::is_base_of_v< Object, From >, int > = 0>
auto dynamic_Object_cast (From *Obj)
 Casts an Object to a derived type. More...
 

Variables

constexpr auto DynExpName = "DynExp"
 DynExp's name string More...
 
constexpr auto DynExpVersion = "@PROJECT_VERSION@"
 DynExp's version string More...
 
constexpr auto DynExpDescription = "Highly flexible laboratory automation for dynamically changing experiments."
 DynExp's description string More...
 
constexpr auto DefaultLocale = "en_US.UTF8"
 Default locale string. More...
 

Detailed Description

DynExp's main namespace contains the implementation of DynExp including classes to manage resources (DynExp objects like hardware adapters, instruments, and modules) as well as their dependencies and parameters.

DynExp's main namespace contains DynExp's core functionality.


Class Documentation

◆ DynExp::LibraryObjectFactoryParamList

class DynExp::LibraryObjectFactoryParamList

template<typename ObjectTypeBasePtr, LibraryObjectFactoryPtrType< ObjectTypeBasePtr > ...>
class DynExp::LibraryObjectFactoryParamList< ObjectTypeBasePtr,... >

Type consisting of function pointer types instantiating DynExp objects. Refer to DynExp::LibraryObjectFactoryPtrType.

Template Parameters
ObjectTypeBasePtrRefer to DynExp::LibraryObjectFactoryPtrType.
...Function pointer types

Definition at line 51 of file Libraries.h.

◆ DynExp::LibraryConfigFactoryParamList

class DynExp::LibraryConfigFactoryParamList

template<LibraryConfigFactoryPtrType...>
class DynExp::LibraryConfigFactoryParamList<... >

Type consisting of function pointer types returning configurators for DynExp objects. Refer to DynExp::ConfiguratorBasePtrType.

Template Parameters
...Function pointer types

Definition at line 59 of file Libraries.h.

◆ DynExp::LibraryStringParamList

class DynExp::LibraryStringParamList

template<LibraryStringParamPtrType...>
class DynExp::LibraryStringParamList<... >

Type consisting of function pointer types returning string literals. Refer to DynExp::LibraryStringParamPtrType.

Template Parameters
...Function pointer types

Definition at line 67 of file Libraries.h.

◆ DynExp::LibraryBase

class DynExp::LibraryBase

template<typename ObjectTypeBasePtr, typename ObjFactories, typename ConfFactories, typename ObjNames, typename ObjCategories>
class DynExp::LibraryBase< ObjectTypeBasePtr, ObjFactories, ConfFactories, ObjNames, ObjCategories >

Represents the base class for a library containing library entries (DynExp::LibraryEntry).

Template Parameters
ObjectTypeBasePtrRefer to DynExp::LibraryObjectFactoryPtrType.
ObjFactoriesType of multiple object factory pointers
ConfFactoriesType of multiple configurator factory pointers
ObjNamesType of multiple function pointers returning the entry names
ObjCategoriesType of multiple function pointers returning the entry categories

Definition at line 112 of file Libraries.h.

◆ DynExp::ManagerTypeOfObjectType

struct DynExp::ManagerTypeOfObjectType

template<typename ObjectType, std::enable_if_t< std::is_base_of_v< HardwareAdapterBase, ObjectType >||std::is_base_of_v< InstrumentBase, ObjectType >, int > = 0>
struct DynExp::ManagerTypeOfObjectType< ObjectType, >

Type trait relating a type ObjectType derived from either class HardwareAdapterBase or class InstrumentBase to the resource manager type (derived from DynExp::CommonResourceManagerBase) managing instances of the type ObjectType.

Template Parameters
ObjectTypeType to relate to a corresponding resource manager

Definition at line 54 of file Object.h.

Class Members
typedef conditional_t< is_base_of_v< HardwareAdapterBase, ObjectType >, HardwareAdapterManager, InstrumentManager > type Resource manager type managing instances of type ObjectType.

Typedef Documentation

◆ ConfiguratorBasePtrType

using DynExp::ConfiguratorBasePtrType = typedef std::shared_ptr<ConfiguratorBase>

Alias for a pointer to the configurator base class ConfiguratorBase.

Definition at line 1959 of file Object.h.

◆ HardwareAdapterLibraryVectorType

Alias for the vector type containing entries of a hardware adapter library.

Definition at line 204 of file Libraries.h.

◆ HardwareAdapterPtrType

using DynExp::HardwareAdapterPtrType = typedef std::shared_ptr<HardwareAdapterBase>

Pointer type to store a hardware adapter (DynExp::HardwareAdapterBase) with.

Definition at line 22 of file HardwareAdapter.h.

◆ InstrumentLibraryVectorType

Alias for the vector type containing entries of a instrument library.

Definition at line 225 of file Libraries.h.

◆ InstrumentPtrType

using DynExp::InstrumentPtrType = typedef std::shared_ptr<InstrumentBase>

Pointer type to store an instrument (DynExp::InstrumentBase) with.

Definition at line 26 of file Instrument.h.

◆ ItemIDListType

using DynExp::ItemIDListType = typedef std::vector<ItemIDType>

Type of a list of IDs belonging to objects managed by DynExp.

Definition at line 40 of file Object.h.

◆ ItemIDType

using DynExp::ItemIDType = typedef size_t

ID type of objects/items managed by DynExp.

Definition at line 50 of file DynExpDefinitions.h.in.

◆ LibraryConfigFactoryPtrType

Alias for a factory function pointer type that creates a configurator for a specific library entry. Compatible e.g. to DynExp::MakeModuleConfig().

Definition at line 30 of file Libraries.h.

◆ LibraryObjectFactoryPtrType

template<typename ObjectTypeBasePtr >
using DynExp::LibraryObjectFactoryPtrType = typedef ObjectTypeBasePtr(*)(const std::thread::id, ParamsBasePtrType&&)

Alias for a factory function pointer type that instantiates library entries to create DynExp objects derived from DynExp::Object. As arguments, it expects the thread ID of the thread owning the resource and a reference to the resource's parameters to take ownership of. Compatible e.g. to DynExp::MakeModule().

Template Parameters
ObjectTypeBasePtrPointer to the base type of a certain DynExp resource (e.g. DynExp::ModulePtrType)

Definition at line 24 of file Libraries.h.

◆ LibraryStringParamPtrType

Pointer to a DynExp object's static constexpr function returning a string literal. Used for the Name() and Category() functions which are required for classes derived from DynExp::Object to become library entries.

Definition at line 42 of file Libraries.h.

◆ LibraryStringType

using DynExp::LibraryStringType = typedef const char*

String type used for library entry descriptors.

Definition at line 35 of file Libraries.h.

◆ ManagerTypeOfObjectType_t

template<typename ObjectType >
using DynExp::ManagerTypeOfObjectType_t = typedef typename ManagerTypeOfObjectType<ObjectType>::type

Alias for a resource manager type (derived from DynExp::CommonResourceManagerBase) managing resources of type ObjectType.

Template Parameters
ObjectTypeRefer to DynExp::ManagerTypeOfObjectType.

Definition at line 72 of file Object.h.

◆ ModuleLibraryVectorType

Alias for the vector type containing entries of a module library.

Definition at line 246 of file Libraries.h.

◆ ModulePtrType

using DynExp::ModulePtrType = typedef std::unique_ptr<ModuleBase>

Pointer type to store a module (DynExp::ModuleBase) with.

Definition at line 23 of file Module.h.

◆ ParamsBasePtrType

using DynExp::ParamsBasePtrType = typedef std::unique_ptr<ParamsBase>

Alias for a pointer to the parameter system base class ParamsBase.

Definition at line 1807 of file Object.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum : ItemIDType

ID of an non-existent object/item.

Enumerator
ItemIDNotSet 

Definition at line 55 of file DynExpDefinitions.h.in.

◆ TextUsageType

enum DynExp::TextUsageType
strong

Specifies the usage of a text-type parameter. Setting the right usage allows the ParamsConfigDialog to add specific functionality to a text field to edit the parameter's value.

Enumerator
Standard 

Plain text, no functionality is added.

Path 

Interprets the text as a file path and adds a 'browse' button.

Code 

Behaves like TextUsageType::Path, but also adds a button to open a text editor to edit the code file the text (interpreted as a file path) points to.

Definition at line 28 of file ParamsConfig.h.

Function Documentation

◆ dynamic_InstrumentData_cast()

template<typename To , typename From , std::enable_if_t< std::is_same_v< InstrumentDataBase, std::remove_cv_t< From >>, int > = 0>
auto DynExp::dynamic_InstrumentData_cast ( Util::SynchronizedPointer< From > &&  InstrumentDataPtr)

Casts the data base class From into a derived InstrumentBase's (To) data class keeping the data locked by Util::SynchronizedPointer for thread-safe casting.

Template Parameters
ToType derived from InstrumentBase into whose data class type to cast. const is added to To if From is const.
FromData class type to cast from (must be InstrumentDataBase). This type is automatically deduced.
Parameters
InstrumentDataPtrLocked data class to cast from. InstrumentDataPtr is empty after the cast.
Returns
Locked data class cast to the data class belonging to To.
Exceptions
Util::InvalidArgExceptionis thrown if InstrumentDataPtr is empty.
Util::TypeErrorExceptionis thrown if the cast fails.

Definition at line 810 of file Instrument.h.

◆ dynamic_ModuleData_cast()

template<typename To , typename From , std::enable_if_t< std::is_same_v< ModuleDataBase, std::remove_cv_t< From >>, int > = 0>
auto DynExp::dynamic_ModuleData_cast ( Util::SynchronizedPointer< From > &&  ModuleDataPtr)

Casts the data base class From into a derived ModuleBase's (To) data class keeping the data locked by Util::SynchronizedPointer for thread-safe casting.

Template Parameters
ToType derived from ModuleBase into whose data class type to cast. const is added to To if From is const.
FromData class type to cast from (must be ModuleDataBase). This type is automatically deduced.
Parameters
ModuleDataPtrLocked data class to cast from. ModuleDataPtr is empty after the cast.
Returns
Locked data class cast to the data class belonging to To.
Exceptions
Util::InvalidArgExceptionis thrown if ModuleDataPtr is empty.
Util::TypeErrorExceptionis thrown if the cast fails.

Definition at line 851 of file Module.h.

◆ dynamic_Object_cast()

template<typename To , typename From , std::enable_if_t< std::is_base_of_v< Object, To > &&std::is_base_of_v< Object, From >, int > = 0>
auto DynExp::dynamic_Object_cast ( From *  Obj)

Casts an Object to a derived type.

Template Parameters
ToType derived from Object to cast to. const is added to To if From is const.
FromType derived from Object to cast from. This type is automatically deduced.
Parameters
ObjPointer to the Object instance to cast
Returns
Returns a pointer to the cast Object instance.

Definition at line 2333 of file Object.h.

◆ dynamic_Params_cast() [1/2]

template<typename T >
T::ParamsType* DynExp::dynamic_Params_cast ( ParamsBasePtrType::element_type *  Params)

Casts the parameter base class to a derived Object's parameter class.

Template Parameters
TType derived from Object to whose parameter type to cast
Parameters
ParamsPointer to the parameter base class
Returns
Returns a pointer to the cast parameter class. Returns nullptr if Params is nullptr.
Exceptions
Util::TypeErrorExceptionis thrown if the cast fails.

Definition at line 1835 of file Object.h.

◆ dynamic_Params_cast() [2/2]

template<typename To , typename From , std::enable_if_t< std::is_same_v< ParamsBase, std::remove_cv_t< From >>, int > = 0>
auto DynExp::dynamic_Params_cast ( Util::SynchronizedPointer< From > &&  ParamsPtr)

Casts the parameter base class From to a derived Object's (To) parameter class keeping the parameters locked by Util::SynchronizedPointer for thread-safe casting.

Template Parameters
ToType derived from Object to whose parameter type to cast. const is added to To if From is const.
FromParameter type to cast from (must be ParamsBase). This type is automatically deduced.
Parameters
ParamsPtrLocked parameters to cast from. ParamsPtr is empty after the cast.
Returns
Locked parameters cast to the parameter class belonging to To.
Exceptions
Util::InvalidArgExceptionis thrown if ParamsPtr is empty.
Util::TypeErrorExceptionis thrown if the cast fails.

Definition at line 1862 of file Object.h.

◆ FindInLibraryVector()

template<typename LibraryVectorT >
const LibraryVectorT::value_type& DynExp::FindInLibraryVector ( const LibraryVectorT &  LibraryVector,
const std::string &  Category,
const std::string &  Name 
)

Finds an entry in a library vector by category and name.

Template Parameters
LibraryVectorTType of the library vector
Parameters
LibraryVectorLibrary vector to search in
CategoryCategory to search for
NameName to search for
Returns
Returns a reference to the found entry.
Exceptions
Util::NotFoundExceptionis thrown if the entry is not found.

Definition at line 258 of file Libraries.h.

◆ InstrumentThreadMain()

int DynExp::InstrumentThreadMain ( InstrumentInstance  Instance,
InstrumentBase *const  Instrument 
)

Instruments run in their own thread. This is the instrument thread's main function.

Parameters
InstanceHandle to the instrument thread's data related to the instrument running this thread. The instrument thread is expected to let the lifetime of Instance expire upon termination.
InstrumentPointer to the instrument running this thread
Returns
Util::DynExpErrorCodes::NoError if the thread terminated without an error, the respective error code otherwise.

Definition at line 8 of file Instrument.cpp.

◆ MakeEvent()

template<typename ReceiverType , typename... ArgsTs>
auto DynExp::MakeEvent ( ReceiverType *  Receiver,
typename DefaultEvent< ReceiverType, std::tuple< std::remove_reference_t< ArgsTs >... >>::EventFuncPtrType  EventFuncPtr,
ArgsTs &&...  Args 
)

Creates an event of type DefaultEvent.

Template Parameters
ReceiverTypeModule type to receive this event.
...ArgsTsTypes of arguments passed to the event function.
Parameters
ReceiverPointer to module receiving this event.
EventFuncPtrEvent function to be invoked (member function of ReceiverType expected).
...ArgsArguments to pass to the event function.
Exceptions
Util::InvalidArgExceptionis thrown if EventFuncPtr is nullptr.

Definition at line 763 of file Module.h.

◆ MakeHardwareAdapter()

template<typename HardwareAdapterT >
HardwareAdapterPtrType DynExp::MakeHardwareAdapter ( const std::thread::id  OwnerThreadID,
ParamsBasePtrType &&  Params 
)

Factory function to generate a hardware adapter of a specific type.

Template Parameters
HardwareAdapterTType of the hardware adapter to generate
Parameters
OwnerThreadIDID of the thread owning the hardware adapter
ParamsReference to the hardware adapter's parameters to take ownership of
Returns
Pointer to the hardware adapter of the specified type

Definition at line 43 of file HardwareAdapter.h.

◆ MakeHardwareAdapterConfig()

template<typename HardwareAdapterT >
ConfiguratorBasePtrType DynExp::MakeHardwareAdapterConfig ( )

Factory function to generate a configurator for a specific hardware adapter type.

Template Parameters
HardwareAdapterTType of the hardware adapter to generate a configurator for
Returns
Pointer to the configurator for the specified hardware adapter type

Definition at line 30 of file HardwareAdapter.h.

◆ MakeInstrument()

template<typename InstrumentT >
InstrumentPtrType DynExp::MakeInstrument ( const std::thread::id  OwnerThreadID,
ParamsBasePtrType &&  Params 
)

Factory function to generate an instrument of a specific type.

Template Parameters
InstrumentTType of the instrument to generate
Parameters
OwnerThreadIDID of the thread owning the instrument
ParamsReference to theinstrument's parameters to take ownership of
Returns
Pointer to the instrument of the specified type

Definition at line 47 of file Instrument.h.

◆ MakeInstrumentConfig()

template<typename InstrumentT >
ConfiguratorBasePtrType DynExp::MakeInstrumentConfig ( )

Factory function to generate a configurator for a specific instrument type.

Template Parameters
InstrumentTType of the instrument to generate a configurator for
Returns
Pointer to the configurator for the specified instrument type

Definition at line 34 of file Instrument.h.

◆ MakeModule()

template<typename ModuleT >
ModulePtrType DynExp::MakeModule ( const std::thread::id  OwnerThreadID,
ParamsBasePtrType &&  Params 
)

Factory function to generate a module of a specific type.

Template Parameters
ModuleTType of the module to generate
Parameters
OwnerThreadIDID of the thread owning the module
ParamsReference to the module's parameters to take ownership of
Returns
Pointer to the module of the specified type

Definition at line 44 of file Module.h.

◆ MakeModuleConfig()

template<typename ModuleT >
ConfiguratorBasePtrType DynExp::MakeModuleConfig ( )

Factory function to generate a configurator for a specific module type.

Template Parameters
ModuleTType of the module to generate a configurator for
Returns
Pointer to the configurator for the specified module type

Definition at line 31 of file Module.h.

◆ MakeParams()

template<typename ConfiguratorT >
ParamsBasePtrType DynExp::MakeParams ( ItemIDType  ID,
const DynExpCore Core 
)

Factory function to generate an Object's parameters.

Template Parameters
ConfiguratorTThe object type is determined by the Object's configurator derived from ConfiguratorBase.
Parameters
IDID of the Object to generate parameters for
CoreReference to DynExp's core
Returns
Pointer to the Object's parameters

Definition at line 1818 of file Object.h.

◆ MakeTask()

template<typename TaskT , typename... ArgTs>
std::unique_ptr<TaskT> DynExp::MakeTask ( ArgTs &&...  Args)

Factory function to create a task to be enqueued in an instrument's task queue.

Template Parameters
TaskTType of a task derived from class TaskBase
...ArgTsTypes of the arguments to forward to the task's constructor
Parameters
...ArgsArguments to forward to the task's constructor
Returns
Pointer to the task of the specified type

Definition at line 63 of file Instrument.h.

◆ ModuleThreadMain()

int DynExp::ModuleThreadMain ( ModuleInstance  Instance,
ModuleBase *const  Module 
)

Modules run in their own thread. This is the module thread's main function.

Parameters
InstanceHandle to the module thread's data related to the module running this thread. The module thread is expected to let the lifetime of Instance expire upon termination.
ModulePointer to the module running this thread
Returns
Util::DynExpErrorCodes::NoError if the thread terminated without an error, the respective error code otherwise.

Definition at line 10 of file Module.cpp.

◆ operator<=>()

template<typename ParamType >
auto DynExp::operator<=> ( const ParamsBase::TypedParamBase< ParamType > &  lhs,
const ParamType &  rhs 
)

Provides three-way comparison for two parameters.

Template Parameters
ParamTypeUnderlying parameter value type
Parameters
lhsLeft-hand side of the comparison
rhsRight-hand side of the comparison
Returns
Returns the result of a three-way comparison between the values of lhs and rhs.

Definition at line 1802 of file Object.h.

◆ operator==()

template<typename ParamType >
auto DynExp::operator== ( const ParamsBase::TypedParamBase< ParamType > &  lhs,
const ParamType &  rhs 
)

Provides (in)equality comparison operators for two parameters. Since C++20, inequality operators (operator!=) are generated by compiler.

Template Parameters
ParamTypeUnderlying parameter value type
Parameters
lhsLeft-hand side of the comparison
rhsRight-hand side of the comparison
Returns
Returns true if the value of lhs equals the value of rhs, false otherwise.

Definition at line 1792 of file Object.h.

◆ WaitForInstruments()

template<typename... InstrTs>
void DynExp::WaitForInstruments ( InstrTs &...  Instruments)

Blocks until every instrument passed to the function as a reference parameter has arrived at a synchronization point.

Template Parameters
...InstrTsTypes of the instruments passed to this function.
Parameters
...InstrumentsInstruments to synchronize.

Definition at line 1234 of file Instrument.h.

Variable Documentation

◆ DefaultLocale

constexpr auto DynExp::DefaultLocale = "en_US.UTF8"
constexpr

Default locale string.

Definition at line 36 of file DynExpDefinitions.h.in.

◆ DynExpDescription

constexpr auto DynExp::DynExpDescription = "Highly flexible laboratory automation for dynamically changing experiments."
constexpr

DynExp's description string

Definition at line 31 of file DynExpDefinitions.h.in.

◆ DynExpName

constexpr auto DynExp::DynExpName = "DynExp"
constexpr

DynExp's name string

Definition at line 21 of file DynExpDefinitions.h.in.

◆ DynExpVersion

constexpr auto DynExp::DynExpVersion = "@PROJECT_VERSION@"
constexpr

DynExp's version string

Definition at line 26 of file DynExpDefinitions.h.in.