|
nmealib 0.0.4
NMEA 0183/NMEA 2000 parsing library
|
Represents a parsed NMEA 0183 MTW (Mean Temperature of Water) sentence. More...
#include <mtw.h>


Public Member Functions | |
| MTW (std::string talkerId, double temperature, char unit) | |
| Construct an MTW message from individual field values. | |
| MTW (const MTW &)=default | |
| MTW & | operator= (const MTW &)=default |
| MTW (MTW &&) noexcept=default | |
| MTW & | operator= (MTW &&) noexcept=default |
| ~MTW () override=default | |
| std::unique_ptr< nmealib::Message > | clone () const override |
| Create a polymorphic copy of this MTW message. | |
| 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. | |
| bool | operator== (const MTW &other) const noexcept |
| Compare two MTW messages for equality. | |
Public Member Functions inherited from nmealib::nmea0183::Message0183 | |
| Message0183 (const Message0183 &)=default | |
| Copy constructor. | |
| Message0183 & | operator= (const Message0183 &)=default |
| Copy assignment operator. | |
| Message0183 (Message0183 &&) noexcept=default | |
| Move constructor. | |
| Message0183 & | operator= (Message0183 &&) noexcept=default |
| Move assignment operator. | |
| ~Message0183 () override=default | |
| Destructor. | |
| char | getStartChar () const noexcept |
| Returns the start character of the NMEA 0183 sentence. | |
| std::string | getTalker () const noexcept |
| Returns the talker identifier extracted from the sentence. | |
| std::string | getSentenceType () const noexcept |
| Returns the sentence type identifier extracted from the sentence. | |
| std::string | getPayload () const noexcept |
| Returns the payload of the NMEA 0183 sentence. | |
| std::string | getChecksumStr () const |
| Get the checksum string extracted from the raw sentence. | |
| std::string | getCalculatedChecksumStr () const noexcept |
| Get the calculated checksum string for the sentence payload. | |
| std::string | serialize () const override |
| Returns the wire-format representation of the NMEA 0183 sentence, that is, the raw information that was passed when the message was created. | |
| bool | operator== (const Message0183 &other) const noexcept |
| Compares two Message0183 objects for equality based on their content and timestamp. | |
| bool | validate () const noexcept override |
| Returns whether the message is valid or not. | |
Public Member Functions inherited from nmealib::Message | |
| Message () | |
| Message (std::string raw, Type type=Type::Unknown, TimePoint ts=std::chrono::system_clock::now()) noexcept | |
| virtual | ~Message () |
| Message (const Message &)=default | |
| Message & | operator= (const Message &)=default |
| Message (Message &&) noexcept=default | |
| Message & | operator= (Message &&) noexcept=default |
| Type | getType () const noexcept |
| Returns the message type. | |
| const std::string & | getRawData () const noexcept |
| Returns the raw, unmodified data string as received. | |
| TimePoint | getTimestamp () const noexcept |
| Returns the timestamp associated with this message. | |
| bool | operator== (const Message &other) const noexcept |
| Compares two Message objects for equality based on their content. | |
Friends | |
| class | Nmea0183Factory |
| class | MessageRegistry |
Additional Inherited Members | |
Public Types inherited from nmealib::Message | |
| enum class | Type { Unknown , NMEA0183 , NMEA2000 } |
| Defines the type of NMEA message, allowing for differentiation between various standards. More... | |
| using | TimePoint = std::chrono::system_clock::time_point |
Static Public Member Functions inherited from nmealib::nmea0183::Message0183 | |
| static double | convertNmeaCoordinateToDecimalDegrees (const std::string &nmeaCoordinate) |
| Converts an NMEA coordinate in ddmm.mmmm / dddmm.mmmm format to decimal degrees. | |
Static Public Member Functions inherited from nmealib::Message | |
| static std::string | typeToString (Type t) |
| Converts a Message::Type enum value to its string representation. | |
Protected Member Functions inherited from nmealib::nmea0183::Message0183 | |
| std::string | toString (bool verbose) const noexcept |
| Provides the common string representation for every NMEA 0183 message, which can be used by derived classes to implement their own getStringContent method. | |
Protected Member Functions inherited from nmealib::Message | |
| void | setType (Type t) noexcept |
| Sets the message type. | |
| void | setRaw (std::string r) noexcept |
| Sets the raw data string. | |
| void | setTimestamp (TimePoint ts) noexcept |
| Sets the message timestamp. | |
Static Protected Member Functions inherited from nmealib::nmea0183::Message0183 | |
| static std::unique_ptr< Message0183 > | create (const std::string &raw, TimePoint ts=std::chrono::system_clock::now()) |
| Protected factory method to create a Message0183 from a raw sentence string. | |
Protected Attributes inherited from nmealib::nmea0183::Message0183 | |
| char | startChar_ |
| std::string | talker_ |
| std::string | sentenceType_ |
| std::string | payload_ |
| std::string | checksumStr_ |
| std::string | calculatedChecksumStr_ |
Protected Attributes inherited from nmealib::Message | |
| std::string | rawData_ |
| Type | type_ {Type::Unknown} |
| TimePoint | timestamp_ {} |
Represents a parsed NMEA 0183 MTW (Mean Temperature of Water) sentence.
The MTW sentence reports the mean temperature of the water as measured by the instrument. The sentence format is:
Fields:
x.x): Water temperature value (floating-point).C): Unit of temperature. Always 'C' (degrees Celsius) per the NMEA 0183 standard.Example sentence:
| nmealib::nmea0183::MTW::MTW | ( | std::string | talkerId, |
| double | temperature, | ||
| char | unit | ||
| ) |
Construct an MTW message from individual field values.
Composes the raw NMEA sentence from the supplied fields and initialises the object. A checksum is automatically appended to the raw sentence.
| talkerId | Two-character talker identifier (e.g., "II", "GP"). |
| temperature | Water temperature in degrees Celsius. |
| unit | Unit of temperature. Should be 'C' (Celsius) as required by the NMEA 0183 standard. |
|
default |
|
defaultnoexcept |
|
overridedefault |
|
overridevirtual |
Create a polymorphic copy of this MTW message.
Reimplemented from nmealib::nmea0183::Message0183.
|
overridevirtualnoexcept |
Return a human-readable string representation of this message.
| verbose | When true, every field is printed on its own labelled line. When false, a compact single-line summary is returned instead. |
Reimplemented from nmealib::nmea0183::Message0183.
|
noexcept |
|
noexcept |
|
noexcept |
Compare two MTW messages for equality.
Two MTW messages are equal when their underlying Message0183 representations are equal (raw sentence, talker, checksum, and timestamp all match).
| other | The MTW message to compare with. |
true if the messages are equal, false otherwise.
|
friend |
|
friend |