19 #define LIST_ALL_MSGS \
30 DOFOR(NV_OEM6_GENERIC_FRAME) \
31 DOFOR(NV_OEM6_BESTPOS) \
33 DOFOR(NV_OEM6_GENERIC_SHORT_FRAME) \
34 DOFOR(NV_OEM6_INSPVAS) \
35 DOFOR(NV_OEM6_RANGECMP) \
36 DOFOR(NV_OEM6_RXSTATUS) \
37 DOFOR(NV_OEM6_RAWEPHEM) \
38 DOFOR(NV_OEM6_VERSION) \
39 DOFOR(NV_OEM6_RAWIMUS) \
40 DOFOR(NV_OEM6_MARKPOS) \
41 DOFOR(NV_OEM6_MARKTIME) \
42 DOFOR(NV_OEM6_MARK2TIME) \
43 DOFOR(NV_OEM6_IONUTC) \
49 #define DOFOR(_MSG_ID) case _MSG_ID: return new Message_##_MSG_ID();
60 #define DOFOR(_MSG_ID) case _MSG_ID: return true;
70 const std::string & gnss_message::getMessageTypeAsString()
const
72 static bool first_call =
true;
73 static std::map<gnss_message_type_t,std::string> gnss_type2str;
77 #define DOFOR(_MSG_ID) gnss_type2str[_MSG_ID] = #_MSG_ID;
82 return gnss_type2str[this->message_type];
89 const int32_t msg_id = message_type;
91 this->internal_writeToStream(out);
100 this->internal_readFromStream(
in);
110 THROW_EXCEPTION_FMT(
"Error deserializing gnss_message: unknown message type '%i'",
static_cast<int>(msg_id));
117 gnss_message_ptr::gnss_message_ptr() : ptr(NULL)
158 hour(0), minute(0), sec(0)
This CStream derived class allow using a memory buffer as a CStream.
uint64_t Seek(int64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning) MRPT_OVERRIDE
Introduces a pure virtual method for moving to a specified position in the streamed resource.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
GLsizei const GLchar ** string
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
mrpt::system::TTimeStamp BASE_IMPEXP buildTimestampFromParts(const mrpt::system::TTimeParts &p)
Builds a timestamp from the parts (Parts are in UTC)
void BASE_IMPEXP timestampToParts(TTimeStamp t, TTimeParts &p, bool localTime=false)
Gets the individual parts of a date/time (days, hours, minutes, seconds) - UTC time or local time.
#define ASSERT_EQUAL_(__A, __B)
#define THROW_EXCEPTION_FMT(_FORMAT_STRING,...)
GNSS (GPS) data structures, mainly for use within mrpt::obs::CObservationGPS.
gnss_message_type_t
List of all known GNSS message types.
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
void readFromStream(mrpt::utils::CStream &in)
Save to binary stream. Launches an exception upon error.
void writeToStream(mrpt::utils::CStream &out) const
Save to binary stream. Launches an exception upon error.
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...
A smart pointer to a GNSS message.
gnss_message_ptr()
Ctor (default: NULL pointer)
virtual ~gnss_message_ptr()
Dtor: it frees the pointee memory.
void set(gnss_message *p)
Replaces the pointee with a new pointer. Its memory now belongs to this object, do not free manually.
gnss_message_ptr & operator=(const gnss_message_ptr &o)
Pure virtual base for all message types.
virtual void internal_readFromStream(mrpt::utils::CStream &in)=0
Save to binary stream. Launches an exception upon error.
void writeToStream(mrpt::utils::CStream &out) const
Save to binary stream. Launches an exception upon error.
static gnss_message * readAndBuildFromStream(mrpt::utils::CStream &in)
Load from binary stream and creates object detecting its type (class factory). Launches an exception ...
The parts of a date/time (it's like the standard 'tm' but with fractions of seconds).
uint8_t minute
Hour (0-23)
double second
Minute (0-59)