35#ifndef _OPENLCB_LATENCYTESTCONSUMER_HXX_
36#define _OPENLCB_LATENCYTESTCONSUMER_HXX_
83 event->event_write_helper<1>()->WriteAsync(
node_,
This class sends a notification in its destructor.
A BarrierNotifiable allows to create a number of child Notifiable and wait for all of them to finish.
BarrierNotifiable * new_child()
Call this for each child task.
An object that can schedule itself on an executor to run.
static EventRegistry * instance()
A notifiable class that calls a particular function object once when it is invoked,...
Structure used in registering event handlers.
This event consumer works together with the hub_test application in order to detect the response late...
void handle_identify_consumer(const EventRegistryEntry &entry, EventReport *event, BarrierNotifiable *done) override
Called on another node sending IdentifyConsumer.
EventReport * event_
Incoming event report we are working on.
void handle_identify_global(const EventRegistryEntry ®istry_entry, EventReport *event, BarrierNotifiable *done) override
Called on the need of sending out identification messages.
Node * node_
Which node should be sending responses.
HookFn hook_
The owner's hook will be invoked and run (asynchronous) before replying.
std::function< void(Notifiable *)> HookFn
To complete the hook, call the notifiable.
static constexpr EventId EVENT_BASE
This is within NMRA ID 1, which is not assigned.
BarrierNotifiable * done_
Will notify this after sending the reply.
Base class for NMRAnet nodes conforming to the asynchronous interface.
SimpleEventHandler ignores all non-essential callbacks.
uint64_t EncodeRange(uint64_t begin, unsigned size)
Creates a single encoded event range from the beginning of the range and the number fo events to cove...
Payload eventid_to_buffer(uint64_t eventid)
Converts an Event ID to a Payload suitable to be sent as an event report.
@ MTI_CONSUMER_IDENTIFIED_UNKNOWN
consumer broadcast, validity unknown
@ MTI_CONSUMER_IDENTIFIED_RANGE
consumer broadcast about a range of consumers
Shared notification structure that is assembled for each incoming event-related message,...
EventId event
The event ID from the incoming message.
Node * dst_node
nullptr for global messages; points to the specific virtual node for addressed events identify messag...
WriteHelper * event_write_helper()
These allow event handlers to produce up to four messages per invocation.