Pure virtual base for all message types.
Definition at line 24 of file gnss_messages_common.h.
#include <mrpt/obs/gnss_messages_common.h>
Public Member Functions | |
gnss_message (gnss_message_type_t msg_type_id) | |
void | writeToStream (mrpt::utils::CStream &out) const |
Save to binary stream. Launches an exception upon error. More... | |
void | readFromStream (mrpt::utils::CStream &in) |
Load from binary stream into this existing object. Launches an exception upon error. More... | |
bool | isOfType (const gnss_message_type_t type_id) const |
template<class MSG_CLASS > | |
bool | isOfClass () const |
virtual void | dumpToStream (mrpt::utils::CStream &out) const =0 |
Dumps the contents of the observation in a human-readable form to a given output stream. More... | |
void | dumpToConsole (std::ostream &o=std::cout) const |
Dumps the contents of the observation in a human-readable form to an std::ostream (default=console) More... | |
virtual bool | getAllFieldDescriptions (std::ostream &o) const |
Dumps a header for getAllFieldValues() More... | |
virtual bool | getAllFieldValues (std::ostream &o) const |
Dumps a line with the sequence of all field values (without a line feed at the end). More... | |
const std::string & | getMessageTypeAsString () const |
Returns "NMEA_GGA", etc. More... | |
virtual | ~gnss_message () |
Static Public Member Functions | |
static gnss_message * | readAndBuildFromStream (mrpt::utils::CStream &in) |
Load from binary stream and creates object detecting its type (class factory). Launches an exception upon error. More... | |
static gnss_message * | Factory (const gnss_message_type_t msg_id) |
Creates message. More... | |
static bool | FactoryKnowsMsgType (const gnss_message_type_t msg_id) |
Returns true if Factory() has a registered constructor for this msg type. More... | |
Public Attributes | |
gnss_message_type_t | message_type |
Type of GNSS message. More... | |
Protected Member Functions | |
virtual void | internal_writeToStream (mrpt::utils::CStream &out) const =0 |
Save to binary stream. Launches an exception upon error. More... | |
virtual void | internal_readFromStream (mrpt::utils::CStream &in)=0 |
Save to binary stream. Launches an exception upon error. More... | |
|
inline |
Definition at line 27 of file gnss_messages_common.h.
|
inlinevirtual |
Definition at line 44 of file gnss_messages_common.h.
void mrpt::obs::gnss::gnss_message::dumpToConsole | ( | std::ostream & | o = std::cout | ) | const |
Dumps the contents of the observation in a human-readable form to an std::ostream (default=console)
|
pure virtual |
Dumps the contents of the observation in a human-readable form to a given output stream.
Implemented in mrpt::obs::gnss::Message_NV_OEM6_VERSION, mrpt::obs::gnss::Message_NV_OEM6_RANGECMP, mrpt::obs::gnss::Message_NMEA_ZDA, mrpt::obs::gnss::Message_NV_OEM6_GENERIC_SHORT_FRAME, mrpt::obs::gnss::Message_NV_OEM6_GENERIC_FRAME, mrpt::obs::gnss::Message_NMEA_VTG, mrpt::obs::gnss::Message_NMEA_RMC, mrpt::obs::gnss::Message_NMEA_GLL, mrpt::obs::gnss::Message_TOPCON_SATS, mrpt::obs::gnss::Message_TOPCON_PZS, and mrpt::obs::gnss::Message_NMEA_GGA.
|
static |
Creates message.
Definition at line 47 of file gnss_messages_common.cpp.
References LIST_ALL_MSGS.
|
static |
Returns true if Factory() has a registered constructor for this msg type.
Definition at line 58 of file gnss_messages_common.cpp.
References LIST_ALL_MSGS.
|
inlinevirtual |
Dumps a header for getAllFieldValues()
Reimplemented in mrpt::obs::gnss::Message_NMEA_ZDA, mrpt::obs::gnss::Message_NMEA_VTG, mrpt::obs::gnss::Message_NMEA_RMC, mrpt::obs::gnss::Message_NMEA_GLL, and mrpt::obs::gnss::Message_NMEA_GGA.
Definition at line 41 of file gnss_messages_common.h.
|
inlinevirtual |
Dumps a line with the sequence of all field values (without a line feed at the end).
Reimplemented in mrpt::obs::gnss::Message_NMEA_ZDA, mrpt::obs::gnss::Message_NMEA_VTG, mrpt::obs::gnss::Message_NMEA_RMC, mrpt::obs::gnss::Message_NMEA_GLL, and mrpt::obs::gnss::Message_NMEA_GGA.
Definition at line 42 of file gnss_messages_common.h.
const std::string & gnss_message::getMessageTypeAsString | ( | ) | const |
Returns "NMEA_GGA", etc.
Definition at line 70 of file gnss_messages_common.cpp.
References LIST_ALL_MSGS.
Referenced by mrpt::hwdrivers::CGPSInterface::implement_parser_NOVATEL_OEM6().
|
protectedpure virtual |
Save to binary stream. Launches an exception upon error.
Implemented in mrpt::obs::gnss::Message_NV_OEM6_VERSION, mrpt::obs::gnss::Message_NV_OEM6_RANGECMP, mrpt::obs::gnss::Message_NV_OEM6_GENERIC_SHORT_FRAME, mrpt::obs::gnss::Message_NV_OEM6_GENERIC_FRAME, mrpt::obs::gnss::Message_TOPCON_SATS, and mrpt::obs::gnss::Message_TOPCON_PZS.
Referenced by readAndBuildFromStream().
|
protectedpure virtual |
Save to binary stream. Launches an exception upon error.
Implemented in mrpt::obs::gnss::Message_NV_OEM6_VERSION, mrpt::obs::gnss::Message_NV_OEM6_RANGECMP, mrpt::obs::gnss::Message_NV_OEM6_GENERIC_SHORT_FRAME, mrpt::obs::gnss::Message_NV_OEM6_GENERIC_FRAME, mrpt::obs::gnss::Message_TOPCON_SATS, and mrpt::obs::gnss::Message_TOPCON_PZS.
|
inline |
Definition at line 33 of file gnss_messages_common.h.
bool mrpt::obs::gnss::gnss_message::isOfType | ( | const gnss_message_type_t | type_id | ) | const |
|
static |
Load from binary stream and creates object detecting its type (class factory). Launches an exception upon error.
Definition at line 104 of file gnss_messages_common.cpp.
References internal_readFromStream(), and THROW_EXCEPTION_FMT.
Referenced by mrpt::obs::gnss::gnss_message_ptr::gnss_message_ptr(), and mrpt::obs::gnss::gnss_message_ptr::operator=().
void gnss_message::readFromStream | ( | mrpt::utils::CStream & | in | ) |
Load from binary stream into this existing object. Launches an exception upon error.
Definition at line 95 of file gnss_messages_common.cpp.
References ASSERT_EQUAL_.
void gnss_message::writeToStream | ( | mrpt::utils::CStream & | out | ) | const |
Save to binary stream. Launches an exception upon error.
Definition at line 87 of file gnss_messages_common.cpp.
Referenced by mrpt::obs::gnss::gnss_message_ptr::gnss_message_ptr(), and mrpt::obs::gnss::gnss_message_ptr::operator=().
gnss_message_type_t mrpt::obs::gnss::gnss_message::message_type |
Type of GNSS message.
Definition at line 25 of file gnss_messages_common.h.
Referenced by mrpt::hwdrivers::CGPSInterface::implement_parser_NOVATEL_OEM6(), and mrpt::obs::CObservationGPS::readFromStream().
Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019 |