nmealib 0.0.4
NMEA 0183/NMEA 2000 parsing library
Loading...
Searching...
No Matches
PGN129025.h
Go to the documentation of this file.
1#pragma once
2
3#include "nmealib/nmea2000.h"
5
6namespace nmealib {
7namespace nmea2000 {
8
20class PGN129025 : public Message2000 {
21public:
22 // Public constructor from parameters, of the reserved field, only the 6 LSBits are considered
23 PGN129025(Latitude latitude,
24 Longitude longitude) noexcept;
25
26 // Accessory constructors
27 PGN129025(const PGN129025&) = default;
28 PGN129025& operator=(const PGN129025&) = default;
29 PGN129025(PGN129025&&) noexcept = default;
30 PGN129025& operator=(PGN129025&&) noexcept = default;
31
32 // Destructor
33 ~PGN129025() override = default;
34
35 // Polymorphic copy
36 std::unique_ptr<nmealib::Message> clone() const override;
37
38 // Getters for PGN 129025 specific fields
40 Latitude getLatitude() const noexcept;
42 Longitude getLongitude() const noexcept;
43
44 // Overridden methods
45 std::string getStringContent(bool verbose) const noexcept override;
46 using Message2000::operator==;
47 bool operator==(const PGN129025& other) const noexcept;
48
49private:
50 Latitude latitude_;
51 Longitude longitude_;
52
53 PGN129025() = delete;
54
55 // Private constructor used by the factory method
56 PGN129025(Message2000 baseMessage,
57 Latitude latitude,
58 Longitude longitude) noexcept;
59
60 // Private internal factory
61 static std::unique_ptr<PGN129025> create(std::unique_ptr<Message2000> baseMessage);
62 static std::string rawPayload(Latitude latitude,
63 Longitude longitude);
64
65 friend class Nmea2000Factory;
66 friend class MessageRegistry;
67};
68
69} // namespace nmea2000
70} // namespace nmealib
Defines a base class for NMEA messages, encapsulating common properties and behaviors.
Definition message.h:14
Represents a generic NMEA 2000 message encapsulating a CAN frame.
Definition nmea2000.h:62
Strongly-typed class representing PGN 129025 - Position, Rapid Update.
Definition PGN129025.h:20
PGN129025(const PGN129025 &)=default
std::string getStringContent(bool verbose) const noexcept override
Returns a human-readable string representation of the message.
Definition PGN129025.cpp:49
PGN129025 & operator=(const PGN129025 &)=default
Longitude getLongitude() const noexcept
Definition PGN129025.cpp:97
PGN129025(PGN129025 &&) noexcept=default
Latitude getLatitude() const noexcept
Definition PGN129025.cpp:93
std::unique_ptr< nmealib::Message > clone() const override
Creates a polymorphic deep copy of this Message2000.
Definition PGN129025.cpp:45