|
Open Model Railroad Network (OpenMRN)
|
Templated implementation of the HubFlow. More...
#include <Hub.hxx>
Public Types | |
| typedef D | value_type |
| Payload of the buffer. | |
| typedef Buffer< value_type > | buffer_type |
| Type of a biffer being forwarded. | |
| typedef FlowInterface< buffer_type > | port_type |
| Base type of an individual port. | |
Public Types inherited from DispatchFlow< Buffer< D >, 1 > | |
| typedef TypedStateFlow< Buffer< D >, DispatchFlowBase< BASE_NUM_PRIO > > | Base |
| Helper typedef of the base class of *this. | |
| typedef StateFlowBase::Action | Action |
| Imports types and functions to allow less typing for the implementation. | |
| typedef FlowInterface< Buffer< D > > | HandlerType |
| Interface type for handlers that can be registered. | |
| typedef MessageType::value_type::id_type | ID |
| Maskable type of the dispatched messages upon which handlers can configure to trigger. | |
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. | |
Public Member Functions | |
| GenericHubFlow (Service *s) | |
| Constructor. | |
| void | register_port (port_type *port) |
| Adds a new port. | |
| void | unregister_port (port_type *port) |
| Removes a previously added port. | |
Public Member Functions inherited from DispatchFlow< Buffer< D >, 1 > | |
| DispatchFlow (Service *service) | |
| Constructor. | |
| Action | entry () OVERRIDE |
| Override method that will be called after each incoming message is dequeued. | |
| void | register_handler (HandlerType *handler, ID id, ID mask) |
| Adds a new handler to this dispatcher. | |
| void | unregister_handler (HandlerType *handler, ID id, ID mask) |
| Removes a specific instance of a handler from this dispatcher. | |
| void | unregister_handler_all (HandlerType *handler) |
| Removes all instances of a handler from this dispatcher. | |
| void | register_fallback_handler (HandlerType *handler) |
| Sets one handler to receive all messages that no other handler has matched. | |
| Action | call_immediately (Callback c) |
| Imediately call the next state upon return. | |
| Action | allocate_and_call (FlowInterface< Buffer< T > > *target_flow, Callback c, Pool *pool=nullptr) |
| Allocates a buffer from a pool and proceed to the next state when allocation is successful. | |
| Action | allocate_and_call (Callback c, QAsync *queue) |
| Allocates an entry from an asynchronous queue, and transitions to a state once the allocation is complete. | |
| Buffer< T > * | get_allocation_result (FlowInterface< Buffer< T > > *target_flow) |
| Takes the result of the asynchronous allocation. | |
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 Pool * | pool () |
| 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. | |
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. | |
Protected Member Functions inherited from DispatchFlow< Buffer< D >, 1 > | |
| Base::ID | get_message_id () OVERRIDE |
| Action | allocate_and_clone () OVERRIDE |
| Requests allocating a new buffer for sending off a clone. | |
| Action | clone () |
| Takes the allocated new buffer, copies the message into it and sends off to the clone target. | |
| void | send_transfer () OVERRIDE |
| Takes the existing buffer and sends off to the target flow. | |
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. | |
Templated implementation of the HubFlow.
| typedef Buffer<value_type> GenericHubFlow< D >::buffer_type |
| typedef FlowInterface<buffer_type> GenericHubFlow< D >::port_type |
| typedef D GenericHubFlow< D >::value_type |
|
inline |
|
inline |
|
inline |