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

Child flow to be used in parents that need translation from node alias to node id. More...

#include <IfCan.hxx>

Inheritance diagram for openlcb::NodeIdLookupFlow:
StateFlow< Buffer< NodeCanonicalizeRequest >, QList< 1 > > TypedStateFlow< MessageType, Base > FlowInterface< MessageType >

Classes

class  ReplyHandler
 Class for listening to the ping response packets. More...
 

Public Member Functions

 NodeIdLookupFlow (IfCan *iface)
 Constructor.
 
Action entry () override
 Starts processing an incoming request.
 
- Public Member Functions inherited from StateFlow< Buffer< NodeCanonicalizeRequest >, QList< 1 > >
 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 Member Functions

Action send_request ()
 Send out a ping request to the destination alias.
 
Action reply_timeout ()
 Called when a reply arrives or the timeout expires.
 
Action return_ok ()
 Terminates the current subflow with no error.
 
Action return_with_error (int error)
 Terminates the current subflow with an error code.
 
NodeCanonicalizeRequestinput ()
 
IfCaniface ()
 

Private Attributes

openlcb::NodeIdLookupFlow::ReplyHandler this
 
BarrierNotifiable bn_
 Helper object for calling subflows.
 
StateFlowTimer timer_ {this}
 Helper object for timed wait.
 

Friends

class ReplyHandler
 

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

Child flow to be used in parents that need translation from node alias to node id.

Definition at line 205 of file IfCan.hxx.

Constructor & Destructor Documentation

◆ NodeIdLookupFlow()

openlcb::NodeIdLookupFlow::NodeIdLookupFlow ( IfCan iface)
inline

Constructor.

Parameters
ifaceis the CAN Interface that the source node is connecting to.

Definition at line 211 of file IfCan.hxx.

Member Function Documentation

◆ entry()

Action openlcb::NodeIdLookupFlow::entry ( )
inlineoverridevirtual

Starts processing an incoming request.

Returns
next action.

Implements TypedStateFlow< MessageType, Base >.

Definition at line 217 of file IfCan.hxx.

◆ iface()

IfCan * openlcb::NodeIdLookupFlow::iface ( )
inlineprivate
Returns
the stored interface

Definition at line 357 of file IfCan.hxx.

◆ input()

NodeCanonicalizeRequest * openlcb::NodeIdLookupFlow::input ( )
inlineprivate
Returns
the current input request.

Definition at line 351 of file IfCan.hxx.

◆ reply_timeout()

Action openlcb::NodeIdLookupFlow::reply_timeout ( )
inlineprivate

Called when a reply arrives or the timeout expires.

Returns
next action.

Definition at line 258 of file IfCan.hxx.

◆ return_ok()

Action openlcb::NodeIdLookupFlow::return_ok ( )
inlineprivate

Terminates the current subflow with no error.

Definition at line 337 of file IfCan.hxx.

◆ return_with_error()

Action openlcb::NodeIdLookupFlow::return_with_error ( int  error)
inlineprivate

Terminates the current subflow with an error code.

Definition at line 343 of file IfCan.hxx.

◆ send_request()

Action openlcb::NodeIdLookupFlow::send_request ( )
inlineprivate

Send out a ping request to the destination alias.

Returns
next action.

Definition at line 244 of file IfCan.hxx.

Friends And Related Symbol Documentation

◆ ReplyHandler

friend class ReplyHandler
friend

Definition at line 334 of file IfCan.hxx.

Member Data Documentation

◆ bn_

BarrierNotifiable openlcb::NodeIdLookupFlow::bn_
private

Helper object for calling subflows.

Definition at line 363 of file IfCan.hxx.

◆ timer_

StateFlowTimer openlcb::NodeIdLookupFlow::timer_ {this}
private

Helper object for timed wait.

Definition at line 365 of file IfCan.hxx.


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