OpenCPN Partial API docs
Loading...
Searching...
No Matches
LoopbackDriver Class Reference

Accept messages to send; treat them as received from outside
More...

#include <comm_drv_loopback.h>

Inheritance diagram for LoopbackDriver:
AbstractCommDriver

Public Member Functions

 LoopbackDriver (DriverListener &l)
 An instance which accepts messages and forwards it the listener

 
bool SendMessage (std::shared_ptr< const NavMsg > msg, std::shared_ptr< const NavAddr > addr) override
 Accept message to forward to listener; addr is not used.
 
- Public Member Functions inherited from AbstractCommDriver
virtual void SetListener (DriverListener &l)
 Set the entity which will receive incoming data.
 
virtual std::pair< CommStatus, std::string > Clone ()
 Create a new virtual interface using a new instance of this driver.
 
std::string Key () const
 
virtual std::unordered_map< std::string, std::string > GetAttributes () const
 

Static Public Member Functions

static std::shared_ptr< const NavMsgParsePluginMessage (const std::string &msg)
 Parse a string as provided by plugin and convert to a navmsg.
 

Additional Inherited Members

- Public Attributes inherited from AbstractCommDriver
const NavAddr::Bus bus
 
const std::string iface
 Physical device for 0183, else a unique string.
 
std::unordered_map< std::string, std::string > attributes
 
- Protected Member Functions inherited from AbstractCommDriver
 AbstractCommDriver (NavAddr::Bus b)
 
 AbstractCommDriver (NavAddr::Bus b, const std::string &s)
 

Detailed Description

Accept messages to send; treat them as received from outside

Definition at line 27 of file comm_drv_loopback.h.

Constructor & Destructor Documentation

◆ LoopbackDriver()

LoopbackDriver::LoopbackDriver ( DriverListener l)
inline

An instance which accepts messages and forwards it the listener

Definition at line 30 of file comm_drv_loopback.h.

Member Function Documentation

◆ ParsePluginMessage()

NavMsgPtr LoopbackDriver::ParsePluginMessage ( const std::string &  msg)
static

Parse a string as provided by plugin and convert to a navmsg.

Parameters
msgFormatted as documented in WriteCommDriver().
Returns
Generic Navmsg pointer, false (nullptr) if msg cannot be parsed.

Definition at line 107 of file comm_drv_loopback.cpp.

◆ SendMessage()

bool LoopbackDriver::SendMessage ( std::shared_ptr< const NavMsg msg,
std::shared_ptr< const NavAddr addr 
)
inlineoverridevirtual

Accept message to forward to listener; addr is not used.

Implements AbstractCommDriver.

Definition at line 46 of file comm_drv_loopback.h.


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