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

This event is intended to make the receiver start an action (like a measurement) after it received a start event (StartEvent). More...

#include <CommonModuleEvents.h>

+ Inheritance diagram for DynExpModule::TriggerEvent:

Public Member Functions

 TriggerEvent ()=default
 Constructs an inter-module event.
 
 TriggerEvent (const TriggerEvent &Other, DynExp::ItemIDType CommunicatorID)
 
virtual ~TriggerEvent ()
 
virtual std::string GetName () const override
 Returns the name of this event type.
 
- Public Member Functions inherited from DynExp::InterModuleEvent< TriggerEvent >
 InterModuleEvent ()=default
 Constructs an inter-module event.
 
 InterModuleEvent (const InterModuleEventBase &Other, ItemIDType CommunicatorID)
 Copy-constrcuts an inter-module event setting the CommunicatorID.
 
virtual ~InterModuleEvent ()
 
virtual InterModuleEventPtrType Clone (ItemIDType CommunicatorID) const override final
 Creates a deep copy of this inter-module instance.
 
virtual size_t GetID () const noexcept override final
 Returns the unique ID of this event type.
 
- Public Member Functions inherited from DynExp::InterModuleEventBase
 InterModuleEventBase ()
 Constructs an inter-module event.
 
 InterModuleEventBase (const InterModuleEventBase &Other, ItemIDType CommunicatorID)
 Copy-constrcuts an inter-module event setting the CommunicatorID.
 
virtual ~InterModuleEventBase ()=0
 
auto GetCommunicatorID () const noexcept
 Getter for CommunicatorID.
 
- Public Member Functions inherited from DynExp::EventBase
 EventBase ()=default
 
virtual ~EventBase ()=0
 
void Invoke (ModuleInstance &Instance) const
 Invokes the event passing the receiving module's instance reference to it. Only to be called from ModuleBase.
 

Private Member Functions

virtual void InvokeWithParamsChild (DynExp::ModuleInstance &Instance, EventListenersType::EventFunctionType EventFunc) const override
 Called by InvokeChild(). Override to call EventFunc with Instance as the first argument and with further arguments of type EventFuncArgs.
 

Additional Inherited Members

- Public Types inherited from DynExp::InterModuleEvent< TriggerEvent >
using EventListenersType = TypedEventListeners< EventFuncArgs... >
 Type of the manager of event listeners, which relates event listeners (instances of ModuleBase) to their event functions. The event functions expect EventFuncArgs as further arguments.
 
- Public Types inherited from DynExp::InterModuleEventBase
using InterModuleEventPtrType = std::unique_ptr< InterModuleEventBase >
 Pointer type to store an inter-module event (InterModuleEventBase).
 
- Static Public Member Functions inherited from DynExp::InterModuleEvent< TriggerEvent >
static auto ID ()
 Getter for EventID.
 
static size_t Publish (InterModuleEventLibrary &Library)
 Publishes this event type to the InterModuleEventLibrary. This function should not be called manually.
 
static InterModuleEventPtrType Make ()
 Factory function for events of type DerivedEvent.
 
static void Register (const ModuleBase &Listener, CallableT EventFunc, ItemIDType CommunicatorID=ItemIDNotSet)
 Registers/Subscribes module Listener to the event with the event function EventFunc. Indirectly calls ModuleBase::AddRegisteredEvent(). If a module-communicator combination has already been registered, this registration is updated.
 
static void Deregister (const ModuleBase &Listener)
 Deregisters/unsubscribes module Listener from the event, regardless of the inter-module communicator instance used to register Listener to the event. Indirectly calls ModuleBase::RemoveRegisteredEvent().
 
static void Deregister (const ModuleBase &Listener, ItemIDType CommunicatorID)
 Deregisters/unsubscribes module Listener from the event, removing a single registration for a particular module/inter-module communicator combination. Indirectly calls ModuleBase::RemoveRegisteredEvent().
 

Detailed Description

This event is intended to make the receiver start an action (like a measurement) after it received a start event (StartEvent).

Definition at line 143 of file CommonModuleEvents.h.

Constructor & Destructor Documentation

◆ TriggerEvent() [1/2]

DynExpModule::TriggerEvent::TriggerEvent ( )
default

Constructs an inter-module event.

◆ TriggerEvent() [2/2]

DynExpModule::TriggerEvent::TriggerEvent ( const TriggerEvent Other,
DynExp::ItemIDType  CommunicatorID 
)
inline

Definition at line 154 of file CommonModuleEvents.h.

◆ ~TriggerEvent()

virtual DynExpModule::TriggerEvent::~TriggerEvent ( )
inlinevirtual

Definition at line 157 of file CommonModuleEvents.h.

Member Function Documentation

◆ GetName()

virtual std::string DynExpModule::TriggerEvent::GetName ( ) const
inlineoverridevirtual

Returns the name of this event type.

Reimplemented from DynExp::InterModuleEvent< TriggerEvent >.

Definition at line 159 of file CommonModuleEvents.h.

◆ InvokeWithParamsChild()

void DynExpModule::TriggerEvent::InvokeWithParamsChild ( DynExp::ModuleInstance Instance,
EventListenersType::EventFunctionType  EventFunc 
) const
overrideprivatevirtual

Called by InvokeChild(). Override to call EventFunc with Instance as the first argument and with further arguments of type EventFuncArgs.

Parameters
InstanceHandle to the module thread's data of the module EventFunc is invoked on.
EventFuncEvent function to invoke.

Definition at line 28 of file CommonModuleEvents.cpp.


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