DynExp
Highly flexible laboratory automation for dynamically changing experiments.
Loading...
Searching...
No Matches
InterModuleCommunicator.h
Go to the documentation of this file.
1// This file is part of DynExp.
2
9#pragma once
10
11#include "stdafx.h"
12#include "DynExpCore.h"
13
14namespace DynExpInstr
15{
16 class InterModuleCommunicator;
17
21 namespace InterModuleCommunicatorTasks
22 {
35
48
61 }
62
76
99
104 {
105 public:
108
111
112 private:
113 virtual DynExp::ParamsBasePtrType MakeParams(DynExp::ItemIDType ID, const DynExp::DynExpCore& Core) const override { return DynExp::MakeParams<InterModuleCommunicatorConfigurator>(ID, Core); }
114 };
115
124 {
125 public:
129
130 constexpr static auto Name() noexcept { return "Inter-Module Communicator"; }
131
136
138
139 virtual std::string GetName() const override { return Name(); }
140
149 void PostEvent(const DynExp::ModuleBase& Caller, const DynExp::InterModuleEventBase& InterModuleEvent) const;
150
151 private:
152 void ResetImpl(dispatch_tag<DynExp::InstrumentBase>) override final;
154
155 // Do not override MakeInitTask(), MakeExitTask(), and MakeUpdateTask() since respective tasks don't do anything.
156
158 };
159}
Defines DynExp's core module as an interface between the UI and DynExp objects.
Configurator class for InterModuleCommunicator.
virtual DynExp::ParamsBasePtrType MakeParams(DynExp::ItemIDType ID, const DynExp::DynExpCore &Core) const override
Override to make derived classes call DynExp::MakeParams with the correct configurator type derived f...
Data class for InterModuleCommunicator.
virtual void ResetImpl(dispatch_tag< InterModuleCommunicatorData >)
void ResetImpl(dispatch_tag< DynExp::InstrumentDataBase >) override final
Refer to DynExp::InstrumentDataBase::Reset(). Using tag dispatch mechanism to ensure that ResetImpl()...
Parameter class for InterModuleCommunicator.
virtual const char * GetParamClassTag() const noexcept override
This function is intended to be overridden once in each derived class returning the name of the respe...
InterModuleCommunicatorParams(DynExp::ItemIDType ID, const DynExp::DynExpCore &Core)
Constructs the parameters for a InterModuleCommunicator instance.
DummyParam Dummy
Dummy parameter which is to be owned once by parameter classes that do not contain any other paramete...
virtual void ConfigureParamsImpl(dispatch_tag< InterModuleCommunicatorParams >)
Called by DynExp::ParamsBase::ConfigureParams() as a starting point for the tag dispatch mechanism to...
void ConfigureParamsImpl(dispatch_tag< DynExp::InstrumentParamsBase >) override final
Called by DynExp::ParamsBase::ConfigureParams() as a starting point for the tag dispatch mechanism to...
Defines a task for deinitializing an instrument within an instrument inheritance hierarchy....
virtual void ExitFuncImpl(dispatch_tag< ExitTask >, DynExp::InstrumentInstance &Instance)
Deinitializes the respective instrument within the instrument inheritance hierarchy....
void ExitFuncImpl(dispatch_tag< DynExp::ExitTaskBase >, DynExp::InstrumentInstance &Instance) override final
Deinitializes the respective instrument within the instrument inheritance hierarchy....
Defines a task for initializing an instrument within an instrument inheritance hierarchy....
void InitFuncImpl(dispatch_tag< DynExp::InitTaskBase >, DynExp::InstrumentInstance &Instance) override final
Initializes the respective instrument within the instrument inheritance hierarchy....
virtual void InitFuncImpl(dispatch_tag< InitTask >, DynExp::InstrumentInstance &Instance)
Initializes the respective instrument within the instrument inheritance hierarchy....
Defines a task for updating an instrument within an instrument inheritance hierarchy....
void UpdateFuncImpl(dispatch_tag< DynExp::UpdateTaskBase >, DynExp::InstrumentInstance &Instance) override final
Updates the respective instrument within the instrument inheritance hierarchy. Call UpdateFuncImpl() ...
virtual void UpdateFuncImpl(dispatch_tag< UpdateTask >, DynExp::InstrumentInstance &Instance)
Updates the respective instrument within the instrument inheritance hierarchy. Call UpdateFuncImpl() ...
Defines an inter-module communicator instrument to exchange events in between DynExp modules....
void PostEvent(const DynExp::ModuleBase &Caller, const DynExp::InterModuleEventBase &InterModuleEvent) const
Inserts the event passed to the function into the event queues of the modules making use of this Inte...
virtual void ResetImpl(dispatch_tag< InterModuleCommunicator >)
Refer to DynExp::Object::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every de...
static constexpr auto Name() noexcept
Every derived class has to redefine this function.
virtual std::string GetName() const override
Returns the name of this Object type.
const DynExp::DynExpCore & Core
Reference to DynExp's core.
void ResetImpl(dispatch_tag< DynExp::InstrumentBase >) override final
Refer to DynExp::Object::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every de...
DynExp's core class acts as the interface between the user interface and DynExp's internal data like ...
Definition DynExpCore.h:127
Defines a task for deinitializing an instrument within an instrument inheritance hierarchy....
Refer to DynExp::ParamsBase::dispatch_tag.
Defines a task for initializing an instrument within an instrument inheritance hierarchy....
Refer to DynExp::ParamsBase::dispatch_tag.
Base class for instruments. Instruments comprise virtual devices (meta instruments) and physial devic...
Definition Instrument.h:480
Configurator class for InstrumentBase.
Definition Instrument.h:464
Data structure to contain data which is synchronized in between different threads....
Definition Instrument.h:135
Refer to ParamsBase::dispatch_tag.
Definition Instrument.h:146
Defines data for a thread belonging to a InstrumentBase instance. Refer to RunnableInstance.
Definition Instrument.h:813
Parameter class for InstrumentBase.
Definition Instrument.h:430
InstrumentParamsBase(ItemIDType ID, const DynExpCore &Core)
Constructs the parameters for a InstrumentBase instance.
Definition Instrument.h:441
Common base class for all inter-module events.
Definition Module.h:1153
Base class for modules. Modules implement programs on their own (e.g. measurement protocols or server...
Definition Module.h:428
const std::thread::id OwnerThreadID
Thread id of the thread which has constructed (and owns) this Object instance.
Definition Object.h:2302
const ParamsBasePtrType Params
Pointer to the parameter class instance belonging to this Object instance.
Definition Object.h:2303
Refer to ParamsBase::dispatch_tag.
Definition Object.h:2018
Dummy parameter which is to be owned once by parameter classes that do not contain any other paramete...
Definition Object.h:522
const ItemIDType ID
ID of the Object this parameter class instance belongs to.
Definition Object.h:1779
const DynExpCore & Core
Reference to DynExp's core.
Definition Object.h:1780
Tag for function dispatching mechanism within this class used when derived classes are not intended t...
Definition Object.h:349
Defines a task for updating an instrument within an instrument inheritance hierarchy....
Refer to DynExp::ParamsBase::dispatch_tag.
DynExp's instrument namespace contains the implementation of DynExp instruments which extend DynExp's...
DynExp's main namespace contains the implementation of DynExp including classes to manage resources (...
std::unique_ptr< ParamsBase > ParamsBasePtrType
Alias for a pointer to the parameter system base class ParamsBase.
Definition Object.h:1807
size_t ItemIDType
ID type of objects/items managed by DynExp.
Accumulates include statements to provide a precompiled header.