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

Simple stateless translator for incoming TCP messages from binary format into the structured format. More...

#include <IfTcpImpl.hxx>

Inheritance diagram for openlcb::TcpRecvFlow:
FlowInterface< Buffer< HubData > > Destructable

Public Member Functions

 TcpRecvFlow (MessageHandler *target)
 
void send (Buffer< HubData > *data, unsigned prio) override
 Entry point for the incoming (binary) data.
 
- Public Member Functions inherited from FlowInterface< Buffer< HubData > >
virtual Poolpool ()
 
virtual Buffer< HubData > * type_helper ()
 This function is never user in the code, but GDB can use it to infer the correct message types.
 
Buffer< HubData > * 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 Attributes

MessageHandlertarget_
 Flow(interface) where to pass on the parsed GenMessage.
 

Additional Inherited Members

- Public Types inherited from FlowInterface< Buffer< HubData > >
typedef Buffer< HubDatamessage_type
 Stores the message template type for external reference.
 
- Static Public Member Functions inherited from FlowInterface< Buffer< HubData > >
static Buffer< HubData > * cast_alloc (QMember *entry)
 Down casts and initializes an asynchronous allocation result to the appropriate flow's buffer type.
 

Detailed Description

Simple stateless translator for incoming TCP messages from binary format into the structured format.

Drops everything to the floor that is not a valid TCP message. Performs synchronous allocation and keeps the done callback passed along.

Definition at line 588 of file IfTcpImpl.hxx.

Constructor & Destructor Documentation

◆ TcpRecvFlow()

openlcb::TcpRecvFlow::TcpRecvFlow ( MessageHandler target)
inline
Parameters
targetis where to send the parsed messages. Usually the interface's dispatcher flow.

Definition at line 593 of file IfTcpImpl.hxx.

Member Function Documentation

◆ send()

void openlcb::TcpRecvFlow::send ( Buffer< HubData > *  data,
unsigned  prio 
)
inlineoverridevirtual

Entry point for the incoming (binary) data.

These are already segmented correctly to openlcb-TCP packet boundaries.

Parameters
databuffer
priopriority

Implements FlowInterface< Buffer< HubData > >.

Definition at line 602 of file IfTcpImpl.hxx.

Member Data Documentation

◆ target_

MessageHandler* openlcb::TcpRecvFlow::target_
private

Flow(interface) where to pass on the parsed GenMessage.

Definition at line 615 of file IfTcpImpl.hxx.


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