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

Message handler that is registered as a fallback handler in the interface's message dispatcher. More...

#include <IfImpl.hxx>

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

Public Member Functions

 UnhandledAddressedMessageHandler (If *service)
 
Action entry () override
 Handler callback for incoming messages.
 
Action fill_oir ()
 Called after the message buffer allocation is complete.
 
- 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.
 

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 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.
 

Detailed Description

Message handler that is registered as a fallback handler in the interface's message dispatcher.

This means that all incoming messages that were not matching the MTI / mask of any existing instantiated handler will end up here.

The standard requires that when an addressed message is not handled by a node (e.g. because it does not know about the MTI at all), then an Optional Interaction Rejected reply be sent to the originator. This flow generates that OIR reply.

Definition at line 279 of file IfImpl.hxx.

Constructor & Destructor Documentation

◆ UnhandledAddressedMessageHandler()

openlcb::UnhandledAddressedMessageHandler::UnhandledAddressedMessageHandler ( If service)
inline

Definition at line 282 of file IfImpl.hxx.

Member Function Documentation

◆ entry()

Action openlcb::UnhandledAddressedMessageHandler::entry ( )
inlineoverridevirtual

Handler callback for incoming messages.

Implements TypedStateFlow< MessageType, Base >.

Definition at line 289 of file IfImpl.hxx.

◆ fill_oir()

Action openlcb::UnhandledAddressedMessageHandler::fill_oir ( )
inline

Called after the message buffer allocation is complete.

Fills in the outgoing Optional Interaction Rejected message and sends it off to the write flow.

Definition at line 311 of file IfImpl.hxx.


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