22 explicit NotHDGException(
const std::string& context,
const std::string& details =
"") :
23 NmeaException(context,
"The sentence is not an HDG sentence", details) {}
49 HDG(std::string talkerId,
50 double magneticHeading,
51 double magneticDeviation,
52 char deviationDirection,
53 double magneticVariation,
54 char variationDirection);
59 HDG& operator=(
HDG&&) noexcept = default;
61 ~
HDG() override = default;
73 bool operator==(const
HDG& other) const noexcept;
76 double magneticHeading_{};
77 double magneticDeviation_{};
78 char deviationDirection_{};
79 double magneticVariation_{};
80 char variationDirection_{};
84 HDG(Message0183 baseMessage,
85 double magneticHeading,
86 double magneticDeviation,
87 char deviationDirection,
88 double magneticVariation,
89 char variationDirection)
noexcept;
91 static std::unique_ptr<HDG> create(std::unique_ptr<Message0183> baseMessage);
92 static std::string composeRaw(
const std::string& talkerId,
93 double magneticHeading,
94 double magneticDeviation,
95 char deviationDirection,
96 double magneticVariation,
97 char variationDirection);
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 HDG (Heading, Deviation & Variation) sentence.
HDG & operator=(const HDG &)=default
double getMagneticVariation() const noexcept
std::unique_ptr< nmealib::Message > clone() const override
Creates a polymorphic deep copy of this message.
std::string getStringContent(bool verbose) const noexcept override
Returns a human-readable string representation of the message content.
char getVariationDirection() const noexcept
double getMagneticDeviation() const noexcept
char getDeviationDirection() const noexcept
double getMagneticHeading() const noexcept
HDG(HDG &&) noexcept=default
HDG(std::string talkerId, double magneticHeading, double magneticDeviation, char deviationDirection, double magneticVariation, char variationDirection)
Construct an HDG message from individual field values.
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 HDG sentence.
NotHDGException(const std::string &context, const std::string &details="")
Construct a NotHDGException with context and optional details.