OpenCPN Partial API docs
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PluginMsg Class Reference

A plugin to plugin json message over the REST interface. More...

#include <comm_navmsg.h>

Inheritance diagram for PluginMsg:
NavMsg KeyProvider

Public Member Functions

 PluginMsg (const std::string &_name, const std::string &_dest_host, const std::string &msg)
 
 PluginMsg (const std::string &_name, const std::string &msg)
 
std::string key () const
 Return unique key used by observable to notify/listen.
 
std::string to_string () const
 Return printable string for logging etc without trailing nl.
 
- Public Member Functions inherited from NavMsg
virtual std::string to_vdr () const
 Return message in unquoted format used by VDR plugin, see https://opencpn-manuals.github.io/main/vdr/log_format.html.
 
std::string GetKey () const
 Alias for key().
 

Public Attributes

const std::string name
 
const std::string message
 
const std::string dest_host
 hostname, ip address or 'localhost'
 
- Public Attributes inherited from NavMsg
const NavAddr::Bus bus
 
std::shared_ptr< const NavAddrsource
 Source address is set by drivers when receiving, unused and should be empty when sending.
 
const NavmsgTimePoint created_at
 

Additional Inherited Members

- Protected Member Functions inherited from NavMsg
 NavMsg (const NavAddr::Bus &_bus, std::shared_ptr< const NavAddr > src)
 

Detailed Description

A plugin to plugin json message over the REST interface.

Definition at line 341 of file comm_navmsg.h.

Constructor & Destructor Documentation

◆ PluginMsg() [1/3]

PluginMsg::PluginMsg ( )
inline

Definition at line 343 of file comm_navmsg.h.

◆ PluginMsg() [2/3]

PluginMsg::PluginMsg ( const std::string &  _name,
const std::string &  _dest_host,
const std::string &  msg 
)
inline

Definition at line 346 of file comm_navmsg.h.

◆ PluginMsg() [3/3]

PluginMsg::PluginMsg ( const std::string &  _name,
const std::string &  msg 
)
inline

Definition at line 354 of file comm_navmsg.h.

Member Function Documentation

◆ key()

std::string PluginMsg::key ( ) const
inlinevirtual

Return unique key used by observable to notify/listen.

Implements NavMsg.

Definition at line 359 of file comm_navmsg.h.

◆ to_string()

std::string PluginMsg::to_string ( ) const
virtual

Return printable string for logging etc without trailing nl.

Avoid messing with utf string.

Reimplemented from NavMsg.

Definition at line 112 of file comm_navmsg.cpp.

Member Data Documentation

◆ dest_host

const std::string PluginMsg::dest_host

hostname, ip address or 'localhost'

Definition at line 365 of file comm_navmsg.h.

◆ message

const std::string PluginMsg::message

Definition at line 364 of file comm_navmsg.h.

◆ name

const std::string PluginMsg::name

Definition at line 363 of file comm_navmsg.h.


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