23 explicit NotMTWException(
const std::string& context,
const std::string& details =
"") :
24 NmeaException(context,
"The sentence is not an MTW sentence", details) {}
59 MTW(std::string talkerId,
66 MTW& operator=(
MTW&&) noexcept = default;
68 ~
MTW() override = default;
112 bool operator==(const
MTW& other) const noexcept;
115 double temperature_{};
120 MTW(Message0183 baseMessage,
124 static std::unique_ptr<MTW> create(std::unique_ptr<Message0183> baseMessage);
125 static std::string composeRaw(
const std::string& talkerId,
Defines a base class for NMEA messages, encapsulating common properties and behaviors.
Base exception class for all NMEA library errors.
Represents a parsed NMEA 0183 MTW (Mean Temperature of Water) sentence.
double getTemperature() const noexcept
Get the water temperature value.
char getUnit() const noexcept
Get the temperature unit character.
std::string getStringContent(bool verbose) const noexcept override
Return a human-readable string representation of this message.
std::unique_ptr< nmealib::Message > clone() const override
Create a polymorphic copy of this MTW message.
MTW & operator=(const MTW &)=default
MTW(MTW &&) noexcept=default
Represents an NMEA 0183 sentence.
Registry for message type creators.
Factory for creating typed NMEA 0183 message objects from raw sentence strings.
Exception thrown when a sentence is not a valid MTW sentence.
NotMTWException(const std::string &context, const std::string &details="")
Construct a NotMTWException with context and optional details.