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...
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) More... | |
using | EventFuncType = typename InstantiatedEventFuncTraitsType::EventFuncType |
Type of a Util::CallableMemberWrapper to store the event. More... | |
Public Member Functions | |
DefaultEvent (EventFuncType EventFunc) noexcept | |
Constructs a DefaultEvent instance. More... | |
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. More... | |
Private Types | |
using | ArgTupleIndexSequenceType = decltype(std::make_index_sequence< std::tuple_size_v< ArgTupleType > >()) |
Index sequence for the (pseudo-)instantiation of EventFuncTraits . More... | |
using | InstantiatedEventFuncTraitsType = decltype(DefaultEvent< ReceiverType, ArgTupleType >::MakeEventFuncTraits(std::declval< ArgTupleIndexSequenceType >())) |
Type of the instantiated EventFuncTraits - not actually instantiating it. More... | |
Private Member Functions | |
virtual void | InvokeChild (ModuleInstance &Instance) const override |
Invokes the event passing the receiving module's instance reference to it. More... | |
Static Private Member Functions | |
template<size_t... Indices> | |
constexpr static auto | MakeEventFuncTraits (std::index_sequence< Indices... >) |
Instantiates EventFuncTraits . This function is not meant to be called. It is used for type deduction only. More... | |
Private Attributes | |
const EventFuncType | EventFunc |
Util::CallableMemberWrapper to store the event receiver, the event function, and its arguments. More... | |
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.