Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
TypedStateFlow< MessageType, Base > Class Template Referenceabstract

Helper class in the StateFlow hierarchy. More...

#include <StateFlow.hxx>

Inheritance diagram for TypedStateFlow< MessageType, Base >:
FlowInterface< MessageType > DispatchFlow< Buffer< D >, 1 > DispatchFlow< Buffer< CanMessageData >, 4 > DispatchFlow< Buffer< HubData >, 1 > DispatchFlow< Buffer< GenMessage >, 4 > DispatchFlow< Buffer< CanHubData >, 1 > DispatchFlow< Buffer< ThrottleCommand >, 1 > StateFlow< Buffer< RequestType >, QList< 1 > > StateFlow< Buffer< Data >, QList< 1 > > StateFlow< Buffer< Chunk >, QList< 1 > > StateFlow< Buffer< ProgrammingTrackRequest >, QList< 1 > > StateFlow< Buffer< dcc::Packet >, QList< 1 > > StateFlow< Buffer< AliasInfo >, QList< 1 > > StateFlow< Buffer< BootloaderRequest >, QList< 1 > > StateFlow< Buffer< BroadcastTimeServerDateRolloverFinishInput >, QList< 1 > > StateFlow< Buffer< BroadcastTimeServerSetInput >, QList< 1 > > StateFlow< Buffer< BroadcastTimeServerSyncInput >, QList< 1 > > StateFlow< Buffer< BroadcastTimeServerTimeInput >, QList< 1 > > StateFlow< Buffer< BulkAliasRequest >, QList< 1 > > StateFlow< Buffer< CanMessageData >, QList< 1 > > StateFlow< Buffer< DccAccyProducerInput >, QList< 1 > > StateFlow< Buffer< EventHandlerCall >, QList< 5 > > StateFlow< Buffer< CanHubData >, QList< 5 > > StateFlow< Buffer< MemoryConfigClientRequest >, QList< 1 > > StateFlow< Buffer< NodeCanonicalizeRequest >, QList< 1 > > StateFlow< Buffer< SNIPClientRequest >, QList< 1 > > StateFlow< Buffer< StreamReceiveRequest >, QList< 1 > > StateFlow< ByteBuffer, QList< 1 > > StateFlow< Buffer< TractionThrottleInput >, QList< 1 > > StateFlow< Buffer< GenMessage >, QList< 4 > > StateFlow< Buffer< ThrottleCommand >, QList< 1 > > StateFlow< Buffer< typename HFlow::value_type >, QList< 1 > >

Public Types

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.
 

Public Member Functions

 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.
 
virtual Action entry () override=0
 Entry into the StateFlow activity.
 
- 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.
 

Protected Member Functions

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.
 

Additional Inherited Members

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

Detailed Description

template<class MessageType, class Base>
class TypedStateFlow< MessageType, Base >

Helper class in the StateFlow hierarchy.

Merges the typed FlowInterface<Msg> abstract base into the regular stateflow hierarchy.

Definition at line 1297 of file StateFlow.hxx.

Member Typedef Documentation

◆ Action

template<class MessageType , class Base >
typedef Base::Action TypedStateFlow< MessageType, Base >::Action

Allows using Action without having StateFlowBase:: prefix in front of it.

Definition at line 1302 of file StateFlow.hxx.

Constructor & Destructor Documentation

◆ TypedStateFlow()

template<class MessageType , class Base >
TypedStateFlow< MessageType, Base >::TypedStateFlow ( Service service)
inline

Constructor.

Parameters
serviceService that this state flow is part of

Definition at line 1307 of file StateFlow.hxx.

◆ ~TypedStateFlow()

template<class MessageType , class Base >
virtual TypedStateFlow< MessageType, Base >::~TypedStateFlow ( )
inlinevirtual

Destructor.

Definition at line 1311 of file StateFlow.hxx.

Member Function Documentation

◆ entry()

template<class MessageType , class Base >
virtual Action TypedStateFlow< MessageType, Base >::entry ( )
overridepure virtual

Entry into the StateFlow activity.

Pure virtual which must be defined by derived class.

Returns
function pointer to next state

Implemented in MockSend, dcc::FakeTrackIf, dcc::LocalTrackIf, dcc::LocalTrackIfSelect, ProgrammingTrackBackend, openlcb::RailcomToOpenLCBDebugProxy, dcc::SimpleUpdateLoop, DispatchFlow< MessageType, NUM_PRIO >, DispatchFlow< Buffer< CanHubData >, 1 >, DispatchFlow< Buffer< CanMessageData >, 4 >, DispatchFlow< Buffer< D >, 1 >, DispatchFlow< Buffer< GenMessage >, 4 >, DispatchFlow< Buffer< HubData >, 1 >, DispatchFlow< Buffer< ThrottleCommand >, 1 >, openlcb::AliasAllocator, openlcb::BootloaderClient, openlcb::BootloaderClient::WriteResponseHandler, openlcb::BootloaderPort, openlcb::BroadcastTimeServerDateRolloverFinish, openlcb::BroadcastTimeServerTime, openlcb::BroadcastTimeServerSync, openlcb::BroadcastTimeServerSet, openlcb::BulkAliasAllocator, openlcb::GcCanRoutingHub::DeliveryFlow, openlcb::DatagramService::DatagramDispatcher, openlcb::CanDatagramParser, openlcb::DccAccyProducer, openlcb::DccPacketDebugFlow, openlcb::EventCallerFlow, openlcb::EventIteratorFlow, openlcb::GlobalCanMessageWriteFlow, openlcb::AliasConflictHandler, openlcb::RemoteAliasCacheUpdater, openlcb::AMEQueryHandler, openlcb::FrameToGlobalMessageParser, openlcb::FrameToAddressedMessageParser, openlcb::NodeIdLookupFlow, openlcb::AddressedCanMessageWriteFlow, openlcb::VerifyNodeIdHandler, openlcb::UnhandledAddressedMessageHandler, openlcb::TcpSendFlow, openlcb::MemoryConfigHandler, openlcb::MemoryConfigClient, openlcb::MemoryConfigClient::ResponseFlow, openlcb::MemoryConfigClientWithStream, openlcb::MemoryConfigStreamHandler, openlcb::InitializeFlow, openlcb::ProtocolIdentificationHandler, openlcb::SimpleInfoFlow, openlcb::SNIPHandler, openlcb::SNIPClient, openlcb::StreamReceiverCan, openlcb::StreamSenderCan, openlcb::TractionResponseHandler, openlcb::TractionProxyService::Impl::ProxyRequestFlow, openlcb::TractionThrottle, openlcb::TrainService::Impl::TractionRequestFlow, traction_modem::TxFlow, BufferPort, HubToGcPort, ESPWifiClient, GCAdapter::BinaryToGCMember, GCAdapter::GCToBinaryMember, DisplayPort, FdHubWriteFlow< Data >, FdHubWriteFlow< typename HFlow::value_type >, HubDeviceSelect< HFlow, ReadFlow >::WriteFlow, NumberDumper::Displayer, FdLoggingServer, and withrottle::ServerCommandLoco.

◆ message()

template<class MessageType , class Base >
MessageType * TypedStateFlow< MessageType, Base >::message ( )
inlineprotected
Returns
the current message we are processing.

Definition at line 1353 of file StateFlow.hxx.

◆ release()

template<class MessageType , class Base >
void TypedStateFlow< MessageType, Base >::release ( )
inlineprotected

Unrefs the current buffer.

Definition at line 1334 of file StateFlow.hxx.

◆ return_buffer()

template<class MessageType , class Base >
void TypedStateFlow< MessageType, Base >::return_buffer ( )
inlineprotected

For state flows that are operated using invoke_subflow_and_wait this is a way to hand back the buffer to the caller.

message() will be null afterwards.

Definition at line 1346 of file StateFlow.hxx.

◆ send()

template<class MessageType , class Base >
void TypedStateFlow< MessageType, Base >::send ( MessageType *  msg,
unsigned  priority = UINT_MAX 
)
inlinevirtual

Sends a message to the state flow for processing.

This function never blocks.

Parameters
msgMessage to enqueue
prioritythe priority at which to enqueue this message.

Implements FlowInterface< MessageType >.

Definition at line 1321 of file StateFlow.hxx.

◆ transfer_message()

template<class MessageType , class Base >
MessageType * TypedStateFlow< MessageType, Base >::transfer_message ( )
inlineprotected

Releases ownership of the current message.

Returns
the current message. Ownership transferred to the caller.

Definition at line 1361 of file StateFlow.hxx.


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