Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
openlcb::EventReport Struct Reference

Shared notification structure that is assembled for each incoming event-related message, and passed around to all event handlers. More...

#include <EventHandler.hxx>

Public Member Functions

template<int N>
WriteHelperevent_write_helper ()
 These allow event handlers to produce up to four messages per invocation.
 
 EventReport (TestingEnum)
 Public constructor for use in tests only.
 

Public Attributes

EventId event
 The event ID from the incoming message.
 
EventId mask
 Specifies the mask in case the request is for an event range.
 
NodeHandle src_node
 Information about the sender of the incoming event-related OpenLCB message.
 
Nodedst_node
 nullptr for global messages; points to the specific virtual node for addressed events identify message.
 
EventState state
 For producer/consumer identified messages, specifies the state of the producer/consumer as the sender of the message (valid/invalid/unknown/reserved).
 

Private Member Functions

 EventReport ()
 Constrained access to the constructors.
 

Private Attributes

WriteHelper write_helpers [4]
 Static objects usable by all event handler implementations.
 

Friends

class EventIteratorFlow
 
class DecoderRangeTest
 

Detailed Description

Shared notification structure that is assembled for each incoming event-related message, and passed around to all event handlers.

Definition at line 64 of file EventHandler.hxx.

Constructor & Destructor Documentation

◆ EventReport() [1/2]

openlcb::EventReport::EventReport ( TestingEnum  )
inline

Public constructor for use in tests only.

Definition at line 95 of file EventHandler.hxx.

◆ EventReport() [2/2]

openlcb::EventReport::EventReport ( )
inlineprivate

Constrained access to the constructors.

We do this because the EventReport structure is pretty expensive due to the statically allocated memory of the write helpers. Only the EventIteratorFlow should have objects of this type.

Definition at line 104 of file EventHandler.hxx.

Member Function Documentation

◆ event_write_helper()

template<int N>
WriteHelper * openlcb::EventReport::event_write_helper ( )
inline

These allow event handlers to produce up to four messages per invocation.

They are always available at the entry to an event handler function.

Definition at line 88 of file EventHandler.hxx.

Friends And Related Symbol Documentation

◆ DecoderRangeTest

friend class DecoderRangeTest
friend

Definition at line 106 of file EventHandler.hxx.

◆ EventIteratorFlow

friend class EventIteratorFlow
friend

Definition at line 105 of file EventHandler.hxx.

Member Data Documentation

◆ dst_node

Node* openlcb::EventReport::dst_node

nullptr for global messages; points to the specific virtual node for addressed events identify message.

Definition at line 79 of file EventHandler.hxx.

◆ event

EventId openlcb::EventReport::event

The event ID from the incoming message.

Definition at line 67 of file EventHandler.hxx.

◆ mask

EventId openlcb::EventReport::mask

Specifies the mask in case the request is for an event range.

The low bits are set to one, the high bits are set to zero. Ranges of size 1 have mask==0, a range that covers all events has mask==0xffff...f.

Definition at line 72 of file EventHandler.hxx.

◆ src_node

NodeHandle openlcb::EventReport::src_node

Information about the sender of the incoming event-related OpenLCB message.

It is not specified whether the node_id or the alias is specified, but they are not both zero.

Definition at line 76 of file EventHandler.hxx.

◆ state

EventState openlcb::EventReport::state

For producer/consumer identified messages, specifies the state of the producer/consumer as the sender of the message (valid/invalid/unknown/reserved).

Definition at line 83 of file EventHandler.hxx.

◆ write_helpers

WriteHelper openlcb::EventReport::write_helpers[4]
private

Static objects usable by all event handler implementations.

Definition at line 109 of file EventHandler.hxx.


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