39 template <
class MSG_CLASS>
42 return isOfType(MSG_CLASS::msg_type);
132 #define GNSS_MESSAGE_BINARY_BLOCK(DATA_PTR, DATA_LEN) \ 134 void internal_writeToStream(mrpt::serialization::CArchive& out) \ 137 out.WriteAs<uint32_t>(DATA_LEN); \ 138 auto nonconst_this = const_cast<std::remove_const< \ 139 std::remove_reference<decltype(*this)>::type>::type*>(this); \ 141 nonconst_this->fixEndianness(); \ 142 out.WriteBuffer(DATA_PTR, DATA_LEN); \ 143 nonconst_this->fixEndianness(); \ 145 void internal_readFromStream(mrpt::serialization::CArchive& in) override \ 147 const uint32_t nBytesInStream = in.ReadAs<uint32_t>(); \ 148 ASSERT_EQUAL_(nBytesInStream, DATA_LEN); \ 149 in.ReadBuffer(DATA_PTR, DATA_LEN); \ 155 #define GNSS_BINARY_MSG_DEFINITION_START(_MSG_ID) \ 156 struct Message_##_MSG_ID : public gnss_message \ 158 GNSS_MESSAGE_BINARY_BLOCK(&fields, sizeof(fields)) \ 163 Message_##_MSG_ID() \ 164 : gnss_message(static_cast<gnss_message_type_t>(msg_type)) \ 169 #define GNSS_BINARY_MSG_DEFINITION_MID \ 170 content_t() = default; \ 174 void dumpToStream(std::ostream& out) const override; 176 #define GNSS_BINARY_MSG_DEFINITION_MID_END \ 180 #define GNSS_BINARY_MSG_DEFINITION_END \ 181 GNSS_BINARY_MSG_DEFINITION_MID \ 182 GNSS_BINARY_MSG_DEFINITION_MID_END 185 #pragma pack(push, 1) 214 #pragma pack(pop) // End of pack = 1 bool operator==(const UTC_time &o) const
const gnss_message * operator->() const
virtual ~gnss_message()=default
virtual bool getAllFieldDescriptions([[maybe_unused]] std::ostream &o) const
Dumps a header for getAllFieldValues()
mrpt::system::TTimeStamp getAsTimestamp(const mrpt::system::TTimeStamp &date) const
Build an MRPT timestamp with the hour/minute/sec of this structure and the date from the given timest...
UTC (Coordinated Universal Time) time-stamp structure for GPS messages.
gnss_message_type_t
List of all known GNSS message types.
void readFromStream(mrpt::serialization::CArchive &in)
Save to binary stream.
gnss_message_ptr & operator=(const gnss_message_ptr &o)
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).
bool isOfType(const gnss_message_type_t type_id) const
bool operator!=(const gnss_message_ptr &o) const
bool operator==(const gnss_message_ptr &o) const
gnss_message(gnss_message_type_t msg_type_id)
void readFromStream(mrpt::serialization::CArchive &in)
Load from binary stream into this existing object.
#define ASSERT_(f)
Defines an assertion mechanism.
mrpt::Clock::time_point TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
bool operator!=(const UTC_time &o) 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.
virtual ~gnss_message_ptr()
Dtor: it frees the pointee memory.
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 t...
static gnss_message * readAndBuildFromStream(mrpt::serialization::CArchive &in)
Load from binary stream and creates object detecting its type (class factory).
void writeToStream(mrpt::serialization::CArchive &out) const
Save to binary stream.
gnss_message_type_t message_type
Type of GNSS message.
static gnss_message * Factory(const gnss_message_type_t msg_id)
Creates message.
gnss_message_ptr()
Ctor (default: nullptr pointer)
bool operator!=(const gnss_message *o) const
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Virtual base class for "archives": classes abstracting I/O streams.
mrpt::vision::TStereoCalibResults out
Pure virtual base for all message types.
virtual void fixEndianness()
If we are in a big endian system, reverse all fields >1 byte to fix its representation.
bool operator==(const gnss_message *o) const
virtual void internal_readFromStream(mrpt::serialization::CArchive &in)=0
Save to binary stream.
static bool FactoryKnowsMsgType(const gnss_message_type_t msg_id)
Returns true if Factory() has a registered constructor for this msg type.
const std::string & getMessageTypeAsString() const
Returns "NMEA_GGA", etc.
virtual void internal_writeToStream(mrpt::serialization::CArchive &out) const =0
Save to binary stream.
void writeToStream(mrpt::serialization::CArchive &out) const
Save to binary stream.
A smart pointer to a GNSS message.
gnss_message *& operator->()