Go to the documentation of this file.
32 template <
class MSG_CLASS>
33 bool isOfClass()
const {
return isOfType(MSG_CLASS::msg_type); }
73 #define GNSS_MESSAGE_BINARY_BLOCK(DATA_PTR,DATA_LEN) \
75 void internal_writeToStream(mrpt::utils::CStream &out) const MRPT_OVERRIDE { \
76 out << static_cast<uint32_t>(DATA_LEN); out.WriteBuffer(DATA_PTR,DATA_LEN); } \
77 void internal_readFromStream(mrpt::utils::CStream &in) MRPT_OVERRIDE { \
78 uint32_t nBytesInStream; in >> nBytesInStream; \
79 ASSERT_EQUAL_(nBytesInStream,DATA_LEN); \
80 in.ReadBuffer(DATA_PTR,DATA_LEN); } \
83 #define GNSS_BINARY_MSG_DEFINITION_START(_MSG_ID) \
84 struct OBS_IMPEXP Message_##_MSG_ID : public gnss_message { \
85 GNSS_MESSAGE_BINARY_BLOCK(&fields,sizeof(fields)) \
86 enum { msg_type = _MSG_ID }; \
87 Message_##_MSG_ID() : gnss_message((gnss_message_type_t)msg_type) {} \
88 struct OBS_IMPEXP content_t {
90 #define GNSS_BINARY_MSG_DEFINITION_MID \
91 content_t() { ::memset(this,0,sizeof(*this)); } \
94 void dumpToStream( mrpt::utils::CStream &out ) const MRPT_OVERRIDE;
97 #define GNSS_BINARY_MSG_DEFINITION_MID_END \
100 #define GNSS_BINARY_MSG_DEFINITION_END \
101 GNSS_BINARY_MSG_DEFINITION_MID \
102 GNSS_BINARY_MSG_DEFINITION_MID_END
123 #pragma pack(pop) // End of pack = 1
static gnss_message * readAndBuildFromStream(mrpt::utils::CStream &in)
Load from binary stream and creates object detecting its type (class factory). Launches an exception ...
bool operator==(const CArray< T, N > &x, const CArray< T, N > &y)
void writeToStream(mrpt::utils::CStream &out) const
Save to binary stream. Launches an exception upon error.
gnss_message_type_t
List of all known GNSS message types.
const gnss_message * get() const
virtual bool getAllFieldDescriptions(std::ostream &o) const
Dumps a header for getAllFieldValues()
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
bool isOfType(const gnss_message_type_t type_id) const
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
gnss_message_ptr(const gnss_message_ptr &o)
Makes a copy of the pointee.
gnss_message_ptr()
Ctor (default: NULL pointer)
UTC (Coordinated Universal Time) time-stamp structure for GPS messages.
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)
gnss_message_type_t message_type
Type of GNSS message.
A smart pointer to a GNSS message.
virtual bool getAllFieldValues(std::ostream &o) const
Dumps a line with the sequence of all field values (without a line feed at the end).
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...
gnss_message_ptr(const gnss_message *p)
Assigns a pointer.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
bool operator!=(const CArray< T, N > &x, const CArray< T, N > &y)
virtual ~gnss_message_ptr()
Dtor: it frees the pointee memory.
void writeToStream(mrpt::utils::CStream &out) const
Save to binary stream. Launches an exception upon error.
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.
void readFromStream(mrpt::utils::CStream &in)
Load from binary stream into this existing object. Launches an exception upon error.
virtual void internal_readFromStream(mrpt::utils::CStream &in)=0
Save to binary stream. Launches an exception upon error.
const std::string & getMessageTypeAsString() const
Returns "NMEA_GGA", etc.
Pure virtual base for all message types.
static gnss_message * Factory(const gnss_message_type_t msg_id)
Creates message.
void set(gnss_message *p)
Replaces the pointee with a new pointer. Its memory now belongs to this object, do not free manually.
static bool FactoryKnowsMsgType(const gnss_message_type_t msg_id)
Returns true if Factory() has a registered constructor for this msg type.
gnss_message(gnss_message_type_t msg_type_id)
void readFromStream(mrpt::utils::CStream &in)
Save to binary stream. Launches an exception upon error.
virtual void internal_writeToStream(mrpt::utils::CStream &out) const =0
Save to binary stream. Launches an exception upon error.
Page generated by Doxygen 1.8.20 for MRPT 1.4.0 SVN: at Thu Aug 27 02:40:23 UTC 2020 | | |