|
Open Model Railroad Network (OpenMRN)
|
Class that advertises an event ID to be produced. More...
#include <EventHandlerTemplates.hxx>
Public Member Functions | |
| FixedEventProducer (Node *node) | |
| void | handle_identify_global (const EventRegistryEntry ®istry_entry, EventReport *event, BarrierNotifiable *done) OVERRIDE |
| Called on the need of sending out identification messages. | |
| void | handle_identify_producer (const EventRegistryEntry ®istry_entry, EventReport *event, BarrierNotifiable *done) OVERRIDE |
| Called on another node sending IdentifyProducer. | |
Public Member Functions inherited from openlcb::SimpleEventHandler | |
| IGNOREFN (handle_event_report) | |
| IGNOREFN (handle_consumer_identified) | |
| IGNOREFN (handle_consumer_range_identified) | |
| IGNOREFN (handle_producer_identified) | |
| IGNOREFN (handle_producer_range_identified) | |
| IGNOREFN (handle_identify_consumer) | |
| IGNOREFN (handle_identify_producer) | |
Public Member Functions inherited from openlcb::EventHandler | |
| virtual void | handle_event_report (const EventRegistryEntry ®istry_entry, EventReport *event, BarrierNotifiable *done)=0 |
| Called on incoming EventReport messages. | |
| virtual void | handle_consumer_identified (const EventRegistryEntry ®istry_entry, EventReport *event, BarrierNotifiable *done) |
| Called on another node sending ConsumerIdentified for this event. | |
| virtual void | handle_consumer_range_identified (const EventRegistryEntry ®istry_entry, EventReport *event, BarrierNotifiable *done) |
| Called on another node sending ConsumerRangeIdentified. | |
| virtual void | handle_producer_identified (const EventRegistryEntry ®istry_entry, EventReport *event, BarrierNotifiable *done) |
| Called on another node sending ProducerIdentified for this event. | |
| virtual void | handle_producer_range_identified (const EventRegistryEntry ®istry_entry, EventReport *event, BarrierNotifiable *done) |
| Called on another node sending ProducerRangeIdentified for this event. | |
| virtual void | handle_identify_consumer (const EventRegistryEntry ®istry_entry, EventReport *event, BarrierNotifiable *done)=0 |
| Called on another node sending IdentifyConsumer. | |
Private Attributes | |
| Node * | node_ |
Additional Inherited Members | |
Public Types inherited from openlcb::EventHandler | |
| using | EventReport = openlcb::EventReport |
| using | EventRegistryEntry = openlcb::EventRegistryEntry |
| using | EventId = openlcb::EventId |
Class that advertises an event ID to be produced.
It does not do anything else. This feature is used by certain protocols to find nodes supporting a given feature, such as IsTrain and IsCommandStation in the traction protocol.
usage:
static const uint64_t IS_TRAIN_EVENT_ID = 0x0101000000000303ULL; FixedEventProducer<IS_TRAIN_EVENT_ID> train_event_producer(&train_node);
The eventID constant must be available at compile time.
Definition at line 130 of file EventHandlerTemplates.hxx.
|
inline |
TODO (balazs.racz) move the event ID argument from the templates to a constructor argument; use the event registry entry value to send out messages to the bus.
Definition at line 133 of file EventHandlerTemplates.hxx.
|
inline |
Definition at line 142 of file EventHandlerTemplates.hxx.
|
inlinevirtual |
Called on the need of sending out identification messages.
| event | is NULL. This happens on startup, or when a global or addressed IdentifyGlobal message arrives. Might have destination node id! |
| registry_entry | gives the registry entry for which the current handler is being called. |
| done | must be notified when the processing is done. |
Implements openlcb::EventHandler.
Definition at line 147 of file EventHandlerTemplates.hxx.
|
inlinevirtual |
Called on another node sending IdentifyProducer.
| event | stores information about the incoming message. Filled: src_node, event, mask=1. Not filled: state. |
| registry_entry | gives the registry entry for which the current handler is being called. |
| done | must be notified when the processing is done. |
Implements openlcb::EventHandler.
Definition at line 159 of file EventHandlerTemplates.hxx.
|
private |
Definition at line 166 of file EventHandlerTemplates.hxx.