Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
openlcb::EventHandler Class Referenceabstract

Abstract base class for all event handlers. More...

#include <EventHandler.hxx>

Inheritance diagram for openlcb::EventHandler:
openlcb::MockEventHandler openlcb::ProxyEventHandler openlcb::SimpleEventHandler openlcb::FixedEventProducer< openlcb::TractionDefs::IS_TRAIN_EVENT > openlcb::FixedEventProducer< TractionDefs::IS_PROXY_EVENT > openlcb::BitEventHandler openlcb::BitRangeEventPC openlcb::BitRangeNonAuthoritativeEventP openlcb::BroadcastTime openlcb::ByteRangeEventC openlcb::CallbackEventHandler openlcb::ConfiguredPulseConsumer openlcb::DccAccyConsumerBase openlcb::DccExtAccyConsumerBase openlcb::FixedEventProducer< EVENT_ID > openlcb::LatencyTestConsumer openlcb::MultiConfiguredConsumer openlcb::MultiConfiguredPC

Public Types

using EventReport = openlcb::EventReport
 
using EventRegistryEntry = openlcb::EventRegistryEntry
 
using EventId = openlcb::EventId
 

Public Member Functions

virtual void handle_event_report (const EventRegistryEntry &registry_entry, EventReport *event, BarrierNotifiable *done)=0
 Called on incoming EventReport messages.
 
virtual void handle_consumer_identified (const EventRegistryEntry &registry_entry, EventReport *event, BarrierNotifiable *done)
 Called on another node sending ConsumerIdentified for this event.
 
virtual void handle_consumer_range_identified (const EventRegistryEntry &registry_entry, EventReport *event, BarrierNotifiable *done)
 Called on another node sending ConsumerRangeIdentified.
 
virtual void handle_producer_identified (const EventRegistryEntry &registry_entry, EventReport *event, BarrierNotifiable *done)
 Called on another node sending ProducerIdentified for this event.
 
virtual void handle_producer_range_identified (const EventRegistryEntry &registry_entry, EventReport *event, BarrierNotifiable *done)
 Called on another node sending ProducerRangeIdentified for this event.
 
virtual void handle_identify_global (const EventRegistryEntry &registry_entry, EventReport *event, BarrierNotifiable *done)=0
 Called on the need of sending out identification messages.
 
virtual void handle_identify_consumer (const EventRegistryEntry &registry_entry, EventReport *event, BarrierNotifiable *done)=0
 Called on another node sending IdentifyConsumer.
 
virtual void handle_identify_producer (const EventRegistryEntry &registry_entry, EventReport *event, BarrierNotifiable *done)=0
 Called on another node sending IdentifyProducer.
 

Detailed Description

Abstract base class for all event handlers.

Instances of this class can get registered with the event service to receive notifications of incoming event messages from the bus.

Definition at line 142 of file EventHandler.hxx.

Member Typedef Documentation

◆ EventId

using openlcb::EventHandler::EventId = openlcb::EventId

Definition at line 147 of file EventHandler.hxx.

◆ EventRegistryEntry

◆ EventReport

Constructor & Destructor Documentation

◆ ~EventHandler()

virtual openlcb::EventHandler::~EventHandler ( )
inlinevirtual

Definition at line 149 of file EventHandler.hxx.

Member Function Documentation

◆ handle_consumer_identified()

virtual void openlcb::EventHandler::handle_consumer_identified ( const EventRegistryEntry registry_entry,
EventReport event,
BarrierNotifiable done 
)
inlinevirtual

Called on another node sending ConsumerIdentified for this event.

Parameters
eventstores information about the incoming message. Filled: event_id, mask=1, src_node, state.
registry_entrygives the registry entry for which the current handler is being called.
donemust be notified when the processing is done.

Reimplemented in openlcb::BroadcastTimeServer, openlcb::CallbackEventHandler, openlcb::BitEventPC, openlcb::ByteRangeEventP, and openlcb::BitRangeNonAuthoritativeEventP.

Definition at line 168 of file EventHandler.hxx.

◆ handle_consumer_range_identified()

virtual void openlcb::EventHandler::handle_consumer_range_identified ( const EventRegistryEntry registry_entry,
EventReport event,
BarrierNotifiable done 
)
inlinevirtual

Called on another node sending ConsumerRangeIdentified.

Parameters
eventstores information about the incoming message. Filled: event id, mask (!= 1), src_node. Not filled: state.
registry_entrygives the registry entry for which the current handler is being called.
donemust be notified when the processing is done.

Reimplemented in openlcb::ByteRangeEventP, and openlcb::BroadcastTimeServer.

Definition at line 180 of file EventHandler.hxx.

◆ handle_event_report()

virtual void openlcb::EventHandler::handle_event_report ( const EventRegistryEntry registry_entry,
EventReport event,
BarrierNotifiable done 
)
pure virtual

Called on incoming EventReport messages.

Parameters
eventstores information about the incoming message. Filled: src_node, event. Mask is always 1 (filled in). state is not filled in.
registry_entrygives the registry entry for which the current handler is being called.
donemust be notified when the processing is done.

Implemented in openlcb::BroadcastTimeClient, openlcb::BroadcastTimeServer, openlcb::CallbackEventHandler, openlcb::BitEventConsumer, openlcb::BitRangeEventPC, openlcb::BitRangeEventP, openlcb::ByteRangeEventC, openlcb::ByteRangeEventP, openlcb::BitRangeNonAuthoritativeEventP, openlcb::ConfiguredPulseConsumer, openlcb::DccAccyConsumerBase, and openlcb::DccExtAccyConsumerBase.

◆ handle_identify_consumer()

virtual void openlcb::EventHandler::handle_identify_consumer ( const EventRegistryEntry registry_entry,
EventReport event,
BarrierNotifiable done 
)
pure virtual

Called on another node sending IdentifyConsumer.

Parameters
eventstores information about the incoming message. Filled: src_node, event, mask=1. Not filled: state.
registry_entrygives the registry entry for which the current handler is being called.
donemust be notified when the processing is done.

Implemented in openlcb::BroadcastTimeClient, openlcb::BroadcastTimeServer, openlcb::DccAccyConsumerBase, openlcb::DccExtAccyConsumerBase, openlcb::BitEventConsumer, openlcb::BitRangeEventPC, openlcb::BitRangeEventP, openlcb::ByteRangeEventC, openlcb::ByteRangeEventP, openlcb::LatencyTestConsumer, openlcb::CallbackEventHandler, and openlcb::ConfiguredPulseConsumer.

◆ handle_identify_global()

virtual void openlcb::EventHandler::handle_identify_global ( const EventRegistryEntry registry_entry,
EventReport event,
BarrierNotifiable done 
)
pure virtual

Called on the need of sending out identification messages.

Parameters
eventis NULL. This happens on startup, or when a global or addressed IdentifyGlobal message arrives. Might have destination node id!
registry_entrygives the registry entry for which the current handler is being called.
donemust be notified when the processing is done.

Implemented in openlcb::BroadcastTimeClient, openlcb::BroadcastTimeServer, openlcb::BitEventProducer, openlcb::BitEventConsumer, openlcb::BitEventPC, openlcb::BitRangeEventPC, openlcb::BitRangeEventP, openlcb::ByteRangeEventC, openlcb::ByteRangeEventP, openlcb::BitRangeNonAuthoritativeEventP, openlcb::CallbackEventHandler, openlcb::ConfiguredPulseConsumer, openlcb::DccAccyConsumerBase, openlcb::DccExtAccyConsumerBase, openlcb::FixedEventProducer< EVENT_ID >, openlcb::FixedEventProducer< openlcb::TractionDefs::IS_TRAIN_EVENT >, openlcb::FixedEventProducer< TractionDefs::IS_PROXY_EVENT >, and openlcb::LatencyTestConsumer.

◆ handle_identify_producer()

virtual void openlcb::EventHandler::handle_identify_producer ( const EventRegistryEntry registry_entry,
EventReport event,
BarrierNotifiable done 
)
pure virtual

Called on another node sending IdentifyProducer.

Parameters
eventstores information about the incoming message. Filled: src_node, event, mask=1. Not filled: state.
registry_entrygives the registry entry for which the current handler is being called.
donemust be notified when the processing is done.

Implemented in openlcb::BroadcastTimeClient, openlcb::BroadcastTimeServer, openlcb::BitEventProducer, openlcb::BitEventPC, openlcb::BitRangeEventPC, openlcb::ByteRangeEventP, openlcb::BitRangeNonAuthoritativeEventP, openlcb::CallbackEventHandler, openlcb::FixedEventProducer< EVENT_ID >, openlcb::FixedEventProducer< openlcb::TractionDefs::IS_TRAIN_EVENT >, and openlcb::FixedEventProducer< TractionDefs::IS_PROXY_EVENT >.

◆ handle_producer_identified()

virtual void openlcb::EventHandler::handle_producer_identified ( const EventRegistryEntry registry_entry,
EventReport event,
BarrierNotifiable done 
)
inlinevirtual

Called on another node sending ProducerIdentified for this event.

Parameters
eventstores information about the incoming message. Filled: event_id, mask=1, src_node, state.
registry_entrygives the registry entry for which the current handler is being called.
user_argis an opaque argument passed in from the registration.
donemust be notified when the processing is done.

Reimplemented in openlcb::BroadcastTimeClient, openlcb::CallbackEventHandler, and openlcb::BitEventConsumer.

Definition at line 193 of file EventHandler.hxx.

◆ handle_producer_range_identified()

virtual void openlcb::EventHandler::handle_producer_range_identified ( const EventRegistryEntry registry_entry,
EventReport event,
BarrierNotifiable done 
)
inlinevirtual

Called on another node sending ProducerRangeIdentified for this event.

Parameters
eventstores information about the incoming message. Filled: event id, mask (!= 1), src_node. Not filled: state.
registry_entrygives the registry entry for which the current handler is being called.
donemust be notified when the processing is done.

Definition at line 206 of file EventHandler.hxx.


The documentation for this class was generated from the following file: