OpenCPN Partial API docs
Loading...
Searching...
No Matches
NavMsg Class Referenceabstract

Actual data sent between application and transport layer. More...

#include <comm_navmsg.h>

Inheritance diagram for NavMsg:
obs::KeyProvider AppNavMsg Nmea0183Msg Nmea2000Msg NullNavMsg PluginMsg SignalkMsg

Public Types

enum class  State { kOk , kCannotParse , kBadChecksum , kFiltered }

Public Member Functions

virtual std::string key () const =0
 Return unique key used by observable to notify/listen.
virtual std::string to_string () const
 Return printable string for logging etc without trailing nl.
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().

Static Public Member Functions

static NavAddr::Bus GetBusByKey (const std::string &key)
 Return bus corresponding to given key.

Public Attributes

const NavAddr::Bus bus
const State state
std::shared_ptr< const NavAddr > source
 Source address is set by drivers when receiving, unused and should be empty when sending.
const NavmsgTimePoint created_at

Protected Member Functions

 NavMsg (const NavAddr::Bus &_bus, std::shared_ptr< const NavAddr > src, State _state)
 NavMsg (const NavAddr::Bus &_bus, std::shared_ptr< const NavAddr > src)

Detailed Description

Actual data sent between application and transport layer.

Definition at line 227 of file comm_navmsg.h.

Member Enumeration Documentation

◆ State

enum class NavMsg::State
strong

Definition at line 229 of file comm_navmsg.h.

Constructor & Destructor Documentation

◆ NavMsg() [1/2]

NavMsg::NavMsg ( const NavAddr::Bus & _bus,
std::shared_ptr< const NavAddr > src,
State _state )
inlineprotected

Definition at line 265 of file comm_navmsg.h.

◆ NavMsg() [2/2]

NavMsg::NavMsg ( const NavAddr::Bus & _bus,
std::shared_ptr< const NavAddr > src )
inlineprotected

Definition at line 270 of file comm_navmsg.h.

Member Function Documentation

◆ GetBusByKey()

NavAddr::Bus NavMsg::GetBusByKey ( const std::string & key)
static

Return bus corresponding to given key.

Definition at line 153 of file comm_navmsg.cpp.

◆ GetKey()

std::string NavMsg::GetKey ( ) const
inlinevirtual

Alias for key().

Implements obs::KeyProvider.

Definition at line 250 of file comm_navmsg.h.

◆ key()

virtual std::string NavMsg::key ( ) const
pure virtual

Return unique key used by observable to notify/listen.

Implemented in AppNavMsg, Nmea0183Msg, Nmea2000Msg, NullNavMsg, PluginMsg, and SignalkMsg.

◆ to_string()

virtual std::string NavMsg::to_string ( ) const
inlinevirtual

Return printable string for logging etc without trailing nl.

Reimplemented in AppNavMsg, Nmea0183Msg, Nmea2000Msg, PluginMsg, and SignalkMsg.

Definition at line 241 of file comm_navmsg.h.

◆ to_vdr()

virtual std::string NavMsg::to_vdr ( ) const
inlinevirtual

Return message in unquoted format used by VDR plugin, see https://opencpn-manuals.github.io/main/vdr/log_format.html.

Reimplemented in Nmea0183Msg, and Nmea2000Msg.

Definition at line 247 of file comm_navmsg.h.

Member Data Documentation

◆ bus

const NavAddr::Bus NavMsg::bus

Definition at line 252 of file comm_navmsg.h.

◆ created_at

const NavmsgTimePoint NavMsg::created_at

Definition at line 262 of file comm_navmsg.h.

◆ source

std::shared_ptr<const NavAddr> NavMsg::source

Source address is set by drivers when receiving, unused and should be empty when sending.

Definition at line 260 of file comm_navmsg.h.

◆ state

const State NavMsg::state

Definition at line 254 of file comm_navmsg.h.


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