Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
openlcb::InlineEventIteratorFlow Class Reference

Flow to receive incoming messages of event protocol, and dispatch them to the registered event handler. More...

#include <EventServiceImpl.hxx>

Inheritance diagram for openlcb::InlineEventIteratorFlow:
openlcb::EventIteratorFlow openlcb::IncomingMessageStateFlow StateFlow< Buffer< GenMessage >, QList< 4 > > TypedStateFlow< MessageType, Base > FlowInterface< MessageType >

Public Member Functions

 InlineEventIteratorFlow (If *iface, EventService *event_service, unsigned mti_value, unsigned mti_mask)
 
- Public Member Functions inherited from openlcb::EventIteratorFlow
 EventIteratorFlow (If *iface, EventService *event_service, unsigned mti_value, unsigned mti_mask)
 
- Public Member Functions inherited from openlcb::IncomingMessageStateFlow
 IncomingMessageStateFlow (If *iface)
 
Ififace ()
 
GenMessagenmsg ()
 Returns the NMRAnet message we received.
 
- Public Member Functions inherited from StateFlow< Buffer< GenMessage >, QList< 4 > >
 StateFlow (Service *service)
 Constructor.
 
- Public Member Functions inherited from TypedStateFlow< MessageType, Base >
 TypedStateFlow (Service *service)
 Constructor.
 
virtual ~TypedStateFlow ()
 Destructor.
 
void send (MessageType *msg, unsigned priority=UINT_MAX) OVERRIDE
 Sends a message to the state flow for processing.
 
- Public Member Functions inherited from FlowInterface< MessageType >
virtual Poolpool ()
 
virtual MessageType * type_helper ()
 This function is never user in the code, but GDB can use it to infer the correct message types.
 
MessageType * alloc ()
 Synchronously allocates a message buffer from the pool of this flow.
 
void alloc_async (Executable *target)
 Asynchronously allocates a message buffer from the pool of this flow.
 

Private Member Functions

Action dispatch_event (const EventRegistryEntry *entry) OVERRIDE
 

Private Attributes

const EventRegistryEntrycurrentEntry_ {nullptr}
 The handler we need to call.
 

Additional Inherited Members

- Public Types inherited from TypedStateFlow< MessageType, Base >
typedef Base::Action Action
 Allows using Action without having StateFlowBase:: prefix in front of it.
 
- Public Types inherited from FlowInterface< MessageType >
typedef MessageType message_type
 Stores the message template type for external reference.
 
- Static Public Member Functions inherited from FlowInterface< MessageType >
static MessageType * cast_alloc (QMember *entry)
 Down casts and initializes an asynchronous allocation result to the appropriate flow's buffer type.
 
- Protected Member Functions inherited from openlcb::EventIteratorFlow
Action entry () OVERRIDE
 Entry into the StateFlow activity.
 
Action iterate_next ()
 
- Protected Member Functions inherited from TypedStateFlow< MessageType, Base >
void release () OVERRIDE
 Unrefs the current buffer.
 
void return_buffer ()
 For state flows that are operated using invoke_subflow_and_wait this is a way to hand back the buffer to the caller.
 
MessageType * message ()
 
MessageType * transfer_message ()
 Releases ownership of the current message.
 
- Protected Attributes inherited from openlcb::EventIteratorFlow
EventServiceeventService_
 
EventReport eventReport_
 Statically allocated structure for calling the event handlers from the main event queue.
 
EventIteratoriterator_
 Iterator for generating the event handlers from the registry.
 
NotifiableincomingDone_
 This done notifiable holds a reference to the incoming message buffer.
 
unsigned eventRegistryEpoch_
 The epoch of the event registry at the start of the iteration.
 
BarrierNotifiable n_
 
EventHandlerFunction fn_
 
uint8_t countEvents_ {0}
 How many events' cost are accumulated so far.
 
uint16_t mtiValue_
 
long long numProcessNsec_ {0}
 Accumulator of how many msec processingthe events took.
 
long long currentProcessStart_ {0}
 When the processing of the current event started.
 
- Static Protected Attributes inherited from openlcb::EventIteratorFlow
static const int REPORT_COUNT = 100
 

Detailed Description

Flow to receive incoming messages of event protocol, and dispatch them to the registered event handler.

This flow runs on the executor of the event service (and not necessarily the interface). Its main job is to iterate through the matching event handler and call each of them for that report.

Definition at line 177 of file EventServiceImpl.hxx.

Constructor & Destructor Documentation

◆ InlineEventIteratorFlow()

openlcb::InlineEventIteratorFlow::InlineEventIteratorFlow ( If iface,
EventService event_service,
unsigned  mti_value,
unsigned  mti_mask 
)
inline

Definition at line 180 of file EventServiceImpl.hxx.

Member Function Documentation

◆ dispatch_event()

StateFlowBase::Action openlcb::InlineEventIteratorFlow::dispatch_event ( const EventRegistryEntry entry)
privatevirtual

Reimplemented from openlcb::EventIteratorFlow.

Definition at line 293 of file EventService.cxx.

Member Data Documentation

◆ currentEntry_

const EventRegistryEntry* openlcb::InlineEventIteratorFlow::currentEntry_ {nullptr}
private

The handler we need to call.

Definition at line 190 of file EventServiceImpl.hxx.


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