Go to the documentation of this file.
39 template <
class MSG_CLASS>
42 return isOfType(MSG_CLASS::msg_type);
121 #define GNSS_MESSAGE_BINARY_BLOCK(DATA_PTR, DATA_LEN) \
123 void internal_writeToStream(mrpt::serialization::CArchive& out) \
126 out << static_cast<uint32_t>(DATA_LEN); \
127 out.WriteBuffer(DATA_PTR, DATA_LEN); \
129 void internal_readFromStream(mrpt::serialization::CArchive& in) override \
131 uint32_t nBytesInStream; \
132 in >> nBytesInStream; \
133 ASSERT_EQUAL_(nBytesInStream, DATA_LEN); \
134 in.ReadBuffer(DATA_PTR, DATA_LEN); \
139 #define GNSS_BINARY_MSG_DEFINITION_START(_MSG_ID) \
140 struct Message_##_MSG_ID : public gnss_message \
142 GNSS_MESSAGE_BINARY_BLOCK(&fields, sizeof(fields)) \
147 Message_##_MSG_ID() : gnss_message((gnss_message_type_t)msg_type) {} \
150 #define GNSS_BINARY_MSG_DEFINITION_MID \
151 content_t() { ::memset(this, 0, sizeof(*this)); } \
155 void dumpToStream(std::ostream& out) const override;
157 #define GNSS_BINARY_MSG_DEFINITION_MID_END \
161 #define GNSS_BINARY_MSG_DEFINITION_END \
162 GNSS_BINARY_MSG_DEFINITION_MID \
163 GNSS_BINARY_MSG_DEFINITION_MID_END
166 #pragma pack(push, 1)
195 #pragma pack(pop) // End of pack = 1
bool operator!=(const gnss_message *o) const
const gnss_message * operator->() const
virtual ~gnss_message_ptr()
Dtor: it frees the pointee memory.
gnss_message_type_t
List of all known GNSS message types.
void readFromStream(mrpt::serialization::CArchive &in)
Save to binary stream.
const gnss_message * get() const
bool operator!=(const gnss_message_ptr &o) const
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...
virtual bool getAllFieldDescriptions(std::ostream &o) const
Dumps a header for getAllFieldValues()
bool operator==(const gnss_message_ptr &o) const
virtual void internal_writeToStream(mrpt::serialization::CArchive &out) const =0
Save to binary stream.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define ASSERT_(f)
Defines an assertion mechanism.
bool isOfType(const gnss_message_type_t type_id) const
Virtual base class for "archives": classes abstracting I/O streams.
bool operator==(const UTC_time &o) const
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
UTC (Coordinated Universal Time) time-stamp structure for GPS messages.
gnss_message_type_t message_type
Type of GNSS message.
A smart pointer to a GNSS message.
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...
virtual bool getAllFieldValues(std::ostream &o) const
Dumps a line with the sequence of all field values (without a line feed at the end).
static bool FactoryKnowsMsgType(const gnss_message_type_t msg_id)
Returns true if Factory() has a registered constructor for this msg type.
virtual void dumpToStream(std::ostream &out) const =0
Dumps the contents of the observation in a human-readable form to a given output stream.
bool operator!=(const UTC_time &o) const
static gnss_message * readAndBuildFromStream(mrpt::serialization::CArchive &in)
Load from binary stream and creates object detecting its type (class factory).
const std::string & getMessageTypeAsString() const
Returns "NMEA_GGA", etc.
void writeToStream(mrpt::serialization::CArchive &out) const
Save to binary stream.
void set(gnss_message *p)
Replaces the pointee with a new pointer.
static gnss_message * Factory(const gnss_message_type_t msg_id)
Creates message.
virtual void internal_readFromStream(mrpt::serialization::CArchive &in)=0
Save to binary stream.
bool operator==(const gnss_message *o) const
GLsizei const GLchar ** string
Pure virtual base for all message types.
gnss_message_ptr & operator=(const gnss_message_ptr &o)
void writeToStream(mrpt::serialization::CArchive &out) const
Save to binary stream.
gnss_message(gnss_message_type_t msg_type_id)
void readFromStream(mrpt::serialization::CArchive &in)
Load from binary stream into this existing object.
gnss_message *& operator->()
gnss_message_ptr()
Ctor (default: nullptr pointer)
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |