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

Flow responsible for queuing outgoing CAN frames as well as sending out the actual frames to the recipients. More...

Inheritance diagram for openlcb::GcCanRoutingHub::DeliveryFlow:
StateFlow< Buffer< CanHubData >, QList< 5 > > TypedStateFlow< MessageType, Base > FlowInterface< MessageType >

Public Member Functions

 DeliveryFlow (Service *s, GcCanRoutingHub *parent)
 
- Public Member Functions inherited from StateFlow< Buffer< CanHubData >, QList< 5 > >
 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.
 

Private Types

enum  ForwardType { FORWARD_ALL , ADDRESSED , EVENT }
 

Private Member Functions

Action entry () override
 Entry into the StateFlow activity.
 
void classify_frame (const can_frame &frame)
 Classifies the incoming frame and sets the class variables determining what to do with it.
 
Action try_next_entry ()
 
Action forward_addressed ()
 
Action done_processing ()
 
void forward_to_port ()
 
void ensure_gc_buf_available ()
 

Private Attributes

ForwardType forwardType_
 
NodeAlias srcAddress_
 
NodeAlias dstAddress_
 
EventId event_
 
PortsMap::iterator nextIt_
 
GcCanRoutingHubparent_
 
Buffer< HubData > * gcBuf_
 Gridconnect-rendered frame.
 

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

Flow responsible for queuing outgoing CAN frames as well as sending out the actual frames to the recipients.

Definition at line 152 of file CanRoutingHub.hxx.

Member Enumeration Documentation

◆ ForwardType

Enumerator
FORWARD_ALL 

Broadcast packet that needs to go out to all ports, unfiltered.

ADDRESSED 

Addressed packet that needs to check the routing table.

EVENT 

Event report packet that needs to check the routing table.

Definition at line 394 of file CanRoutingHub.hxx.

Constructor & Destructor Documentation

◆ DeliveryFlow()

openlcb::GcCanRoutingHub::DeliveryFlow::DeliveryFlow ( Service s,
GcCanRoutingHub parent 
)
inline

Definition at line 155 of file CanRoutingHub.hxx.

Member Function Documentation

◆ classify_frame()

void openlcb::GcCanRoutingHub::DeliveryFlow::classify_frame ( const can_frame &  frame)
inlineprivate

Classifies the incoming frame and sets the class variables determining what to do with it.

Definition at line 215 of file CanRoutingHub.hxx.

◆ done_processing()

Action openlcb::GcCanRoutingHub::DeliveryFlow::done_processing ( )
inlineprivate

Definition at line 349 of file CanRoutingHub.hxx.

◆ ensure_gc_buf_available()

void openlcb::GcCanRoutingHub::DeliveryFlow::ensure_gc_buf_available ( )
inlineprivate

Definition at line 382 of file CanRoutingHub.hxx.

◆ entry()

Action openlcb::GcCanRoutingHub::DeliveryFlow::entry ( )
inlineoverrideprivatevirtual

Entry into the StateFlow activity.

Pure virtual which must be defined by derived class.

Returns
function pointer to next state

Implements TypedStateFlow< MessageType, Base >.

Definition at line 162 of file CanRoutingHub.hxx.

◆ forward_addressed()

Action openlcb::GcCanRoutingHub::DeliveryFlow::forward_addressed ( )
inlineprivate

Definition at line 342 of file CanRoutingHub.hxx.

◆ forward_to_port()

void openlcb::GcCanRoutingHub::DeliveryFlow::forward_to_port ( )
inlineprivate

Definition at line 359 of file CanRoutingHub.hxx.

◆ try_next_entry()

Action openlcb::GcCanRoutingHub::DeliveryFlow::try_next_entry ( )
inlineprivate

Definition at line 315 of file CanRoutingHub.hxx.

Member Data Documentation

◆ dstAddress_

NodeAlias openlcb::GcCanRoutingHub::DeliveryFlow::dstAddress_
private

Definition at line 407 of file CanRoutingHub.hxx.

◆ event_

EventId openlcb::GcCanRoutingHub::DeliveryFlow::event_
private

Definition at line 408 of file CanRoutingHub.hxx.

◆ forwardType_

ForwardType openlcb::GcCanRoutingHub::DeliveryFlow::forwardType_
private

Definition at line 405 of file CanRoutingHub.hxx.

◆ gcBuf_

Buffer<HubData>* openlcb::GcCanRoutingHub::DeliveryFlow::gcBuf_
private

Gridconnect-rendered frame.

Definition at line 412 of file CanRoutingHub.hxx.

◆ nextIt_

PortsMap::iterator openlcb::GcCanRoutingHub::DeliveryFlow::nextIt_
private

Definition at line 409 of file CanRoutingHub.hxx.

◆ parent_

GcCanRoutingHub* openlcb::GcCanRoutingHub::DeliveryFlow::parent_
private

Definition at line 410 of file CanRoutingHub.hxx.

◆ srcAddress_

NodeAlias openlcb::GcCanRoutingHub::DeliveryFlow::srcAddress_
private

Definition at line 406 of file CanRoutingHub.hxx.


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