30 using TimePoint = std::chrono::system_clock::time_point;
33 explicit Message(std::string raw,
35 TimePoint ts = std::chrono::system_clock::now()) noexcept;
56 const std::
string&
getRawData() const noexcept;
94 bool operator==(const
Message& other) const noexcept;
113 void setRaw(std::string r)
noexcept;
Defines a base class for NMEA messages, encapsulating common properties and behaviors.
void setType(Type t) noexcept
Sets the message type.
void setRaw(std::string r) noexcept
Sets the raw data string.
std::chrono::system_clock::time_point TimePoint
const std::string & getRawData() const noexcept
Returns the raw, unmodified data string as received.
virtual std::string serialize() const =0
Produces the wire-format representation of this message.
Type getType() const noexcept
Returns the message type.
Type
Defines the type of NMEA message, allowing for differentiation between various standards.
void setTimestamp(TimePoint ts) noexcept
Sets the message timestamp.
virtual std::unique_ptr< Message > clone() const =0
Creates a polymorphic deep copy of this message.
virtual bool validate() const =0
Validates the message contents (e.g., checksum, length).
TimePoint getTimestamp() const noexcept
Returns the timestamp associated with this message.
static std::string typeToString(Type t)
Converts a Message::Type enum value to its string representation.