|
DynExp
Highly flexible laboratory automation for dynamically changing experiments.
|
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...
#include <Module.h>
Inheritance diagram for DynExp::DefaultEvent< ReceiverType, ArgTupleType >:Classes | |
| struct | EventFuncTraits |
Helper struct to allow accessing elements within ArgTupleType. More... | |
Public Types | |
| using | EventFuncPtrType = typename InstantiatedEventFuncTraitsType::EventFuncPtrType |
Signature of an event function. Pointer to ModuleInstance to be passed as parameter instead of reference to render function pointers storable in Util::CallableMemberWrapper (with nullptr as default argument) " | |
| using | EventFuncType = typename InstantiatedEventFuncTraitsType::EventFuncType |
| Type of a Util::CallableMemberWrapper to store the event. | |
Public Member Functions | |
| DefaultEvent (EventFuncType EventFunc) noexcept | |
Constructs a DefaultEvent instance. | |
| virtual | ~DefaultEvent () |
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. | |
Private Types | |
| using | ArgTupleIndexSequenceType = decltype(std::make_index_sequence< std::tuple_size_v< ArgTupleType > >()) |
Index sequence for the (pseudo-)instantiation of EventFuncTraits. | |
| using | InstantiatedEventFuncTraitsType = decltype(DefaultEvent< ReceiverType, ArgTupleType >::MakeEventFuncTraits(std::declval< ArgTupleIndexSequenceType >())) |
Type of the instantiated EventFuncTraits - not actually instantiating it. | |
Private Member Functions | |
| virtual void | InvokeChild (ModuleInstance &Instance) const override |
| Invokes the event passing the receiving module's instance reference to it. | |
Static Private Member Functions | |
| template<size_t... Indices> | |
| static constexpr auto | MakeEventFuncTraits (std::index_sequence< Indices... >) |
Instantiates EventFuncTraits. This function is not meant to be called. It is used for type deduction only. | |
Private Attributes | |
| const EventFuncType | EventFunc |
| Util::CallableMemberWrapper to store the event receiver, the event function, and its arguments. | |
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).
| ReceiverType | Type of the receiving module. |
| ArgTupleType | Type of a tuple of the arguments' types the receiver's member function expects. |
|
private |
Index sequence for the (pseudo-)instantiation of EventFuncTraits.
| using DynExp::DefaultEvent< ReceiverType, ArgTupleType >::EventFuncPtrType = typename InstantiatedEventFuncTraitsType::EventFuncPtrType |
Signature of an event function. Pointer to ModuleInstance to be passed as parameter instead of reference to render function pointers storable in Util::CallableMemberWrapper (with nullptr as default argument) "
"
| using DynExp::DefaultEvent< ReceiverType, ArgTupleType >::EventFuncType = typename InstantiatedEventFuncTraitsType::EventFuncType |
Type of a Util::CallableMemberWrapper to store the event.
|
private |
Type of the instantiated EventFuncTraits - not actually instantiating it.
|
inlinenoexcept |
Constructs a DefaultEvent instance.
| EventFunc | Util::CallableMemberWrapper to store the event receiver, the event function, and its arguments. |
|
inlinevirtual |
|
inlineoverrideprivatevirtual |
Invokes the event passing the receiving module's instance reference to it.
| Instance | Module instance handle. |
Implements DynExp::EventBase.
|
inlinestaticconstexprprivate |
Instantiates EventFuncTraits. This function is not meant to be called. It is used for type deduction only.
| ...Indices | Index sequence for the (pseudo-)instantiation of EventFuncTraits. |
EventFuncTraits.
|
private |
Util::CallableMemberWrapper to store the event receiver, the event function, and its arguments.