|
Open Model Railroad Network (OpenMRN)
|
A hub flow that accepts string HUB ports sending CAN frames via the GridConnect protocol, performs routing decisions on the frames and sends out to the appropriate ports. More...
#include <CanRoutingHub.hxx>
Classes | |
| class | DeliveryFlow |
| Flow responsible for queuing outgoing CAN frames as well as sending out the actual frames to the recipients. More... | |
| struct | PortParser |
| Data and objects we keep for each port. More... | |
Public Types | |
| typedef HubData | value_type |
| typedef Buffer< value_type > | buffer_type |
| typedef FlowInterface< buffer_type > | port_type |
Public Types inherited from FlowInterface< Buffer< HubData > > | |
| typedef Buffer< HubData > | message_type |
| Stores the message template type for external reference. | |
Public Member Functions | |
| GcCanRoutingHub (Service *s) | |
| void | send (Buffer< HubData > *b, unsigned priority=UINT_MAX) override |
| Entry point to the flow. | |
| CanHubPortInterface * | can_hub () |
| void | register_port (HubPortInterface *port) |
| void | unregister_port (HubPortInterface *port) |
Public Member Functions inherited from FlowInterface< Buffer< HubData > > | |
| virtual Pool * | pool () |
| 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 Types | |
| typedef std::map< void *, PortParser > | PortsMap |
Private Member Functions | |
| unsigned | reprioritize_frame (const struct can_frame &frame, unsigned old_priority) |
| Computes the desired priority of a CAN frame. | |
Private Attributes | |
| DeliveryFlow | deliveryFlow_ |
| std::map< void *, PortParser > | ports_ |
| Keyed by the skipMember_ value of the incoming data from a given port. | |
| OSMutex | lock_ |
| std::vector< void * > | pendingRemove_ |
| Due to race conditions involving iteration and add/remove calls, we delay applying unregister requests until the next packet is being sent. | |
| RoutingLogic< CanHubPortInterface, NodeAlias > | routingTable_ |
Friends | |
| class | DeliveryFlow |
Additional Inherited Members | |
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. | |
A hub flow that accepts string HUB ports sending CAN frames via the GridConnect protocol, performs routing decisions on the frames and sends out to the appropriate ports.
TODO: need to process consumer and producer identified messages. TODO: need to exclude CHECK ID frames from the source address learning.
Definition at line 58 of file CanRoutingHub.hxx.
Definition at line 62 of file CanRoutingHub.hxx.
Definition at line 63 of file CanRoutingHub.hxx.
|
private |
Definition at line 134 of file CanRoutingHub.hxx.
Definition at line 61 of file CanRoutingHub.hxx.
|
inline |
Definition at line 65 of file CanRoutingHub.hxx.
|
inline |
@TODO: need a priority wrapper:
Definition at line 104 of file CanRoutingHub.hxx.
|
inline |
Definition at line 112 of file CanRoutingHub.hxx.
|
inlineprivate |
Computes the desired priority of a CAN frame.
| frame | is the CAN frame (at the input side). |
| old_priority | is the incoming priority of the frame, as it arrived from the previous flow. |
Definition at line 143 of file CanRoutingHub.hxx.
|
inlineoverridevirtual |
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. |
Implements FlowInterface< Buffer< HubData > >.
Definition at line 70 of file CanRoutingHub.hxx.
|
inline |
Definition at line 119 of file CanRoutingHub.hxx.
|
friend |
Definition at line 417 of file CanRoutingHub.hxx.
|
private |
Definition at line 415 of file CanRoutingHub.hxx.
|
private |
Definition at line 431 of file CanRoutingHub.hxx.
|
private |
Due to race conditions involving iteration and add/remove calls, we delay applying unregister requests until the next packet is being sent.
Definition at line 435 of file CanRoutingHub.hxx.
|
private |
Keyed by the skipMember_ value of the incoming data from a given port.
Definition at line 430 of file CanRoutingHub.hxx.
|
private |
Definition at line 437 of file CanRoutingHub.hxx.