|
Open Model Railroad Network (OpenMRN)
|
Flow to receive incoming messages of event protocol, and dispatch them to the registered event handler. More...
#include <EventServiceImpl.hxx>
Public Member Functions | |
| EventIteratorFlow (If *iface, EventService *event_service, unsigned mti_value, unsigned mti_mask) | |
Public Member Functions inherited from openlcb::IncomingMessageStateFlow | |
| IncomingMessageStateFlow (If *iface) | |
| If * | iface () |
| GenMessage * | nmsg () |
| 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 Pool * | pool () |
| 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. | |
Protected Member Functions | |
| 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 | |
| EventService * | eventService_ |
| EventReport | eventReport_ |
| Statically allocated structure for calling the event handlers from the main event queue. | |
| EventIterator * | iterator_ |
| Iterator for generating the event handlers from the registry. | |
| Notifiable * | incomingDone_ |
| 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 | |
| static const int | REPORT_COUNT = 100 |
Private Member Functions | |
| virtual Action | dispatch_event (const EventRegistryEntry *entry) |
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. | |
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 127 of file EventServiceImpl.hxx.
| openlcb::EventIteratorFlow::EventIteratorFlow | ( | If * | iface, |
| EventService * | event_service, | ||
| unsigned | mti_value, | ||
| unsigned | mti_mask | ||
| ) |
Definition at line 88 of file EventService.cxx.
| openlcb::EventIteratorFlow::~EventIteratorFlow | ( | ) |
Definition at line 100 of file EventService.cxx.
|
privatevirtual |
Definition at line 278 of file EventService.cxx.
|
protectedvirtual |
Entry into the StateFlow activity.
Pure virtual which must be defined by derived class.
@TODO(balazs.racz) refactor this into a global constant.
Implements TypedStateFlow< MessageType, Base >.
Definition at line 131 of file EventService.cxx.
|
protected |
Definition at line 238 of file EventService.cxx.
|
protected |
How many events' cost are accumulated so far.
Definition at line 164 of file EventServiceImpl.hxx.
|
protected |
When the processing of the current event started.
Definition at line 169 of file EventServiceImpl.hxx.
|
protected |
The epoch of the event registry at the start of the iteration.
Used to recognize when the iterators are invalidated.
Definition at line 156 of file EventServiceImpl.hxx.
|
protected |
Statically allocated structure for calling the event handlers from the main event queue.
Definition at line 146 of file EventServiceImpl.hxx.
|
protected |
Definition at line 142 of file EventServiceImpl.hxx.
|
protected |
Definition at line 159 of file EventServiceImpl.hxx.
|
protected |
This done notifiable holds a reference to the incoming message buffer.
We must not release this notifiable until we have completed processing and freed all the buffers related to this iteration.
Definition at line 153 of file EventServiceImpl.hxx.
|
protected |
Iterator for generating the event handlers from the registry.
Definition at line 149 of file EventServiceImpl.hxx.
|
protected |
Definition at line 165 of file EventServiceImpl.hxx.
|
protected |
Definition at line 158 of file EventServiceImpl.hxx.
|
protected |
Accumulator of how many msec processingthe events took.
Definition at line 167 of file EventServiceImpl.hxx.
|
staticprotected |
Definition at line 162 of file EventServiceImpl.hxx.