|
Open Model Railroad Network (OpenMRN)
|
Consumer event handler for a sequence of bytes represented by a dense block of consecutive event IDs. More...
#include <EventHandlerTemplates.hxx>
Public Member Functions | |
| ByteRangeEventC (Node *node, uint64_t event_base, uint8_t *backing_store, unsigned size) | |
| Creates a new byte range listener. | |
| void | SendIdentified (WriteHelper *writer, BarrierNotifiable *done) |
| Sends out a ConsumerRangeIdentified. | |
| virtual void | notify_changed (unsigned offset) |
| This function is called by the handler when a data value overwrite event arrives. | |
| void | handle_event_report (const EventRegistryEntry &entry, EventReport *event, BarrierNotifiable *done) override |
| Called on incoming EventReport messages. | |
| void | handle_identify_consumer (const EventRegistryEntry &entry, EventReport *event, BarrierNotifiable *done) override |
| Called on another node sending IdentifyConsumer. | |
| void | handle_identify_global (const EventRegistryEntry &entry, EventReport *event, BarrierNotifiable *done) override |
| Called on the need of sending out identification messages. | |
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_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_producer (const EventRegistryEntry ®istry_entry, EventReport *event, BarrierNotifiable *done)=0 |
| Called on another node sending IdentifyProducer. | |
Protected Member Functions | |
| bool | DecodeEventId (uint64_t event_id, uint8_t **data, uint8_t *value) |
| takes an event ID and checks if we are responsible for it. | |
Protected Attributes | |
| uint64_t | event_base_ |
| Node * | node_ |
| uint8_t * | data_ |
| unsigned | size_ |
Additional Inherited Members | |
Public Types inherited from openlcb::EventHandler | |
| using | EventReport = openlcb::EventReport |
| using | EventRegistryEntry = openlcb::EventRegistryEntry |
| using | EventId = openlcb::EventId |
Consumer event handler for a sequence of bytes represented by a dense block of consecutive event IDs.
Each byte has a consecutive block of 256 events.
Definition at line 840 of file EventHandlerTemplates.hxx.
| openlcb::ByteRangeEventC::ByteRangeEventC | ( | Node * | node, |
| uint64_t | event_base, | ||
| uint8_t * | backing_store, | ||
| unsigned | size | ||
| ) |
Creates a new byte range listener.
backing store points to memory of at least size bytes. This class will advertise consuming size * 256 events contiguous from event_base. event_base will set byte 0 to value 0, event_base + 1 will set byte 0 to value 1, event_base + 256 will set byte 1 to value zero, event_base + 257 will set byte 1 to value 1, etc.
Definition at line 303 of file EventHandlerTemplates.cxx.
|
virtual |
Definition at line 315 of file EventHandlerTemplates.cxx.
|
protected |
takes an event ID and checks if we are responsible for it.
Returns false if it is an uninteresting eventid, returns true and fills *data with the byte pointer and *value with the corresponding value.
Definition at line 341 of file EventHandlerTemplates.cxx.
|
overridevirtual |
Called on incoming EventReport messages.
| event | stores information about the incoming message. Filled: src_node, event. Mask is always 1 (filled in). state is not filled in. |
| 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.
Reimplemented in openlcb::ByteRangeEventP.
Definition at line 320 of file EventHandlerTemplates.cxx.
|
overridevirtual |
Called on another node sending IdentifyConsumer.
| 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.
Reimplemented in openlcb::ByteRangeEventP.
Definition at line 357 of file EventHandlerTemplates.cxx.
|
overridevirtual |
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.
Reimplemented in openlcb::ByteRangeEventP.
Definition at line 375 of file EventHandlerTemplates.cxx.
|
inlinevirtual |
This function is called by the handler when a data value overwrite event arrives.
Definition at line 858 of file EventHandlerTemplates.hxx.
| void openlcb::ByteRangeEventC::SendIdentified | ( | WriteHelper * | writer, |
| BarrierNotifiable * | done | ||
| ) |
Sends out a ConsumerRangeIdentified.
Definition at line 389 of file EventHandlerTemplates.cxx.
|
protected |
Definition at line 879 of file EventHandlerTemplates.hxx.
|
protected |
Definition at line 877 of file EventHandlerTemplates.hxx.
|
protected |
Definition at line 878 of file EventHandlerTemplates.hxx.
|
protected |
Definition at line 880 of file EventHandlerTemplates.hxx.