Struct gnss_message

Inheritance Relationships

Derived Types

Struct Documentation

struct gnss_message

Pure virtual base for all message types.

Subclassed by mrpt::obs::gnss::Message_NMEA_GGA, mrpt::obs::gnss::Message_NMEA_GLL, mrpt::obs::gnss::Message_NMEA_GSA, mrpt::obs::gnss::Message_NMEA_RMC, mrpt::obs::gnss::Message_NMEA_VTG, mrpt::obs::gnss::Message_NMEA_ZDA, mrpt::obs::gnss::Message_NV_OEM6_GENERIC_FRAME, mrpt::obs::gnss::Message_NV_OEM6_GENERIC_SHORT_FRAME, mrpt::obs::gnss::Message_NV_OEM6_RANGECMP, mrpt::obs::gnss::Message_NV_OEM6_VERSION, mrpt::obs::gnss::Message_TOPCON_PZS, mrpt::obs::gnss::Message_TOPCON_SATS

Public Functions

inline gnss_message(gnss_message_type_t msg_type_id)
void writeToStream(mrpt::serialization::CArchive &out) const

Save to binary stream. Launches an exception upon error

void readFromStream(mrpt::serialization::CArchive &in)

Load from binary stream into this existing object. Launches an exception upon error.

inline bool isOfType(const gnss_message_type_t type_id) const
template<class MSG_CLASS>
inline bool isOfClass() const
virtual void dumpToStream(std::ostream &out) const = 0

Dumps the contents of the observation in a human-readable form to a given output stream

See also

dumpToConsole()

inline virtual void fixEndianness()

If we are in a big endian system, reverse all fields >1 byte to fix its representation. Only in binary frames, text-based derived classes obviously do not need to reimplement this one.

virtual void dumpToConsole(std::ostream &o) const

Dumps the contents of the observation in a human-readable form to an std::ostream (set to std::cout to print to console)

inline virtual bool getAllFieldDescriptions([[maybe_unused]] std::ostream &o) const

Dumps a header for getAllFieldValues()

Returns:

false if not implemented for this message type

inline virtual bool getAllFieldValues([[maybe_unused]] std::ostream &o) const

Dumps a line with the sequence of all field values (without a line feed at the end).

Returns:

false if not implemented for this message type

const std::string &getMessageTypeAsString() const

Returns “NMEA_GGA”, etc.

virtual ~gnss_message() = default

Public Members

gnss_message_type_t message_type

Type of GNSS message

Public Static Functions

static gnss_message *readAndBuildFromStream(mrpt::serialization::CArchive &in)

Load from binary stream and creates object detecting its type (class factory). Launches an exception upon error

static gnss_message *Factory(gnss_message_type_t msg_id)

Creates message

Returns:

nullptr on unknown msg type

static bool FactoryKnowsMsgType(gnss_message_type_t msg_id)

Returns true if Factory() has a registered constructor for this msg type

Protected Functions

virtual void internal_writeToStream(mrpt::serialization::CArchive &out) const = 0

Save to binary stream. Launches an exception upon error

virtual void internal_readFromStream(mrpt::serialization::CArchive &in) = 0

Save to binary stream. Launches an exception upon error