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

An instance of this class will add Protocol Identification Protocol to an NMRAnet Node. More...

#include <ProtocolIdentification.hxx>

Inheritance diagram for openlcb::ProtocolIdentificationHandler:
openlcb::IncomingMessageStateFlow StateFlow< Buffer< GenMessage >, QList< 4 > > TypedStateFlow< MessageType, Base > FlowInterface< MessageType >

Public Member Functions

 ProtocolIdentificationHandler (Node *node, uint64_t supported)
 Constructor.
 
 ~ProtocolIdentificationHandler ()
 Destructor.
 
- Public Member Functions inherited from openlcb::IncomingMessageStateFlow
 IncomingMessageStateFlow (If *iface)
 
Ififace ()
 
GenMessagenmsg ()
 Returns the NMRAnet message we received.
 
- Public Member Functions inherited from StateFlow< Buffer< GenMessage >, QList< 4 > >
 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 entry () OVERRIDE
 Entry point to state flow.
 
Action fill_response_buffer ()
 Respond to incoming request with an outgoing message.
 
 DISALLOW_COPY_AND_ASSIGN (ProtocolIdentificationHandler)
 

Private Attributes

Nodenode_
 local copy of the node we are binding to
 
Payload payload_
 response payload
 

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

An instance of this class will add Protocol Identification Protocol to an NMRAnet Node.

Definition at line 47 of file ProtocolIdentification.hxx.

Constructor & Destructor Documentation

◆ ProtocolIdentificationHandler()

openlcb::ProtocolIdentificationHandler::ProtocolIdentificationHandler ( Node node,
uint64_t  supported 
)
inline

Constructor.

Parameters
nodenode for which to add protocol to.
supportedbit mask of supported Defs::Protocols for the node

Definition at line 54 of file ProtocolIdentification.hxx.

◆ ~ProtocolIdentificationHandler()

openlcb::ProtocolIdentificationHandler::~ProtocolIdentificationHandler ( )
inline

Destructor.

Definition at line 69 of file ProtocolIdentification.hxx.

Member Function Documentation

◆ entry()

Action openlcb::ProtocolIdentificationHandler::entry ( )
inlineprivatevirtual

Entry point to state flow.

Returns
release_and_exit() if not for this node
allocate_and_call() for fill_response_buffer() to responde with an outgoing message

Implements TypedStateFlow< MessageType, Base >.

Definition at line 82 of file ProtocolIdentification.hxx.

◆ fill_response_buffer()

Action openlcb::ProtocolIdentificationHandler::fill_response_buffer ( )
inlineprivate

Respond to incoming request with an outgoing message.

Returns

Definition at line 99 of file ProtocolIdentification.hxx.

Member Data Documentation

◆ node_

Node* openlcb::ProtocolIdentificationHandler::node_
private

local copy of the node we are binding to

Definition at line 114 of file ProtocolIdentification.hxx.

◆ payload_

Payload openlcb::ProtocolIdentificationHandler::payload_
private

response payload

Definition at line 117 of file ProtocolIdentification.hxx.


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