|
Open Model Railroad Network (OpenMRN)
|
Abstract class for message recipients. More...
#include <StateFlow.hxx>
Classes | |
| class | GenericHandler |
Public Types | |
| typedef MessageType | message_type |
| Stores the message template type for external reference. | |
Public Member Functions | |
| virtual Pool * | pool () |
| virtual void | send (MessageType *message, unsigned priority=UINT_MAX)=0 |
| Entry point to the flow. | |
| 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. | |
Static Public Member Functions | |
| static MessageType * | cast_alloc (QMember *entry) |
| Down casts and initializes an asynchronous allocation result to the appropriate flow's buffer type. | |
Abstract class for message recipients.
A common base class for various handlers. Most of them are implemented as StateFlow classes. However, if the receiving flow does not need asynchronous handling, it is possible to directly implement a descendant of a specific FlowInterface by overriding the send() method.
Definition at line 1116 of file StateFlow.hxx.
| typedef MessageType FlowInterface< MessageType >::message_type |
Stores the message template type for external reference.
Definition at line 1120 of file StateFlow.hxx.
|
inlinevirtual |
Definition at line 1122 of file StateFlow.hxx.
|
inline |
Synchronously allocates a message buffer from the pool of this flow.
Definition at line 1151 of file StateFlow.hxx.
|
inline |
Asynchronously allocates a message buffer from the pool of this flow.
| target | Will call target->AllocationCallback with the pointer. The callee shall come back and use cast_alloc to turn the pointer into a usable object. |
Definition at line 1162 of file StateFlow.hxx.
|
inlinestatic |
Down casts and initializes an asynchronous allocation result to the appropriate flow's buffer type.
| entry | is the value that got returned by allocation_callback of this pool. |
Definition at line 1175 of file StateFlow.hxx.
|
inlinevirtual |
Reimplemented in dcc::FakeTrackIf, dcc::LocalTrackIf, CanFrameWriteFlow, CanFrameReadFlow, and GCAdapter::BinaryToGCMember.
Definition at line 1128 of file StateFlow.hxx.
|
pure virtual |
Entry point to the flow.
Users of the flow should call this mehtod to send a buffer to the flow.
| message | buffer to send to the flow |
| priority | which priority back the flow should process it. Lower numbers mean process earlier. |
Implemented in GcPacketPrinter::Impl, CanFrameWriteFlow, CanFrameReadFlow, openlcb::AliasAllocator::ConflictHandler, openlcb::AddressedCanMessageWriteFlow::AliasDefListener, openlcb::StreamReceiverCan::StreamDataHandler, dcc::MockTrackIf, openlcb::MockHubPort, openlcb::GcCanRoutingHub, openlcb::TcpRecvFlow, openlcb::MemoryConfigClientWithStream::DefaultSink, openlcb::CollectData, openlcb::MemoryConfigHandler, openlcb::DatagramClientImpl::ReplyListener, FlowInterface< MessageType >::GenericHandler, TypedStateFlow< MessageType, Base >, TypedStateFlow< MessageType, DispatchFlowBase< BASE_NUM_PRIO > >, TypedStateFlow< MessageType, UntypedStateFlow< QueueType > >, and openlcb::AMEGlobalQueryHandler.
|
inlinevirtual |
This function is never user in the code, but GDB can use it to infer the correct message types.
It has to be virtual so that it is not optimized away.
Definition at line 1144 of file StateFlow.hxx.