|
DynExp
Highly flexible laboratory automation for dynamically changing experiments.
|
Typed base class for inter-module events to realize CRTP. More...
#include <Module.h>
Inheritance diagram for DynExp::InterModuleEvent< DerivedEvent, EventFuncArgs >:Public Types | |
| 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 Member Functions | |
| InterModuleEvent ()=default | |
| virtual | ~InterModuleEvent () |
Public Member Functions inherited from DynExp::InterModuleEventBase | |
| InterModuleEventBase ()=default | |
| virtual | ~InterModuleEventBase ()=0 |
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. | |
Static Public Member Functions | |
| template<typename CallableT > | |
| static void | Register (const ModuleBase &Listener, CallableT EventFunc) |
Registers/Subscribes module Listener to the event with the event function EventFunc. Indirectly calls ModuleBase::AddRegisteredEvent(). | |
| static void | Deregister (const ModuleBase &Listener) |
Deregisters/unsubscribes module Listener from the event. Indirectly calls ModuleBase::RemoveRegisteredEvent(). | |
Private Member Functions | |
| virtual void | InvokeChild (ModuleInstance &Instance) const override final |
| Invokes the event passing the receiving module's instance reference to it. | |
Override | |
Override by derived classes. | |
| virtual void | InvokeWithParamsChild (ModuleInstance &Instance, EventListenersType::EventFunctionType EventFunc) const =0 |
Called by InvokeChild(). Override to call EventFunc with Instance as the first argument and with further arguments of type EventFuncArgs. | |
Static Private Attributes | |
| static EventListenersType | Listeners |
Holds one EventListenersType instance per derived event, which manages all the subscribers of DerivedEvent. | |
Typed base class for inter-module events to realize CRTP.
| DerivedEvent | Type of the class derived from InterModuleEvent |
| ...EventFuncArgs | Types of the arguments to be passed to event functions registered/subscribed to DerivedEvent. |
| using DynExp::InterModuleEvent< DerivedEvent, EventFuncArgs >::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.
|
default |
|
inlinevirtual |
|
inlinestatic |
Deregisters/unsubscribes module Listener from the event. Indirectly calls ModuleBase::RemoveRegisteredEvent().
| Listener | Module to deregister/unsubscribe. |
|
inlinefinaloverrideprivatevirtual |
Invokes the event passing the receiving module's instance reference to it.
| Instance | Module instance handle. |
Implements DynExp::EventBase.
|
privatepure virtual |
Called by InvokeChild(). Override to call EventFunc with Instance as the first argument and with further arguments of type EventFuncArgs.
| Instance | Handle to the module thread's data of the module EventFunc is invoked on. |
| EventFunc | Event function to invoke. |
|
inlinestatic |
Registers/Subscribes module Listener to the event with the event function EventFunc. Indirectly calls ModuleBase::AddRegisteredEvent().
| CallableT | Type of the event function (member function of Listener's derived type) to invoke for Listener when the event is triggered. |
| Listener | Module to register/subscribe. |
| EventFunc | Event function to invoke on module Listener when the event is triggered. |
|
staticprivate |
Holds one EventListenersType instance per derived event, which manages all the subscribers of DerivedEvent.
Instantiate the respective static InterModuleEvent::Listeners variable to avoid linker errors.