nmealib 0.0.4
NMEA 0183/NMEA 2000 parsing library
Loading...
Searching...
No Matches
Classes | Public Member Functions | Friends | List of all members
nmealib::nmea0183::GSV Class Reference

#include <gsv.h>

Inheritance diagram for nmealib::nmea0183::GSV:
Inheritance graph
[legend]
Collaboration diagram for nmealib::nmea0183::GSV:
Collaboration graph
[legend]

Classes

struct  SatelliteInfo
 

Public Member Functions

 GSV (std::string talkerId, unsigned int totalSentences, unsigned int sentenceNumber, unsigned int satellitesInView, std::vector< SatelliteInfo > satellites, std::optional< unsigned int > signalId=std::nullopt)
 
 GSV (const GSV &)=default
 
GSVoperator= (const GSV &)=default
 
 GSV (GSV &&) noexcept=default
 
GSVoperator= (GSV &&) noexcept=default
 
 ~GSV () override=default
 
std::unique_ptr< nmealib::Messageclone () const override
 Creates a polymorphic deep copy of this message.
 
unsigned int getTotalSentences () const noexcept
 
unsigned int getSentenceNumber () const noexcept
 
unsigned int getSatellitesInView () const noexcept
 
const std::vector< SatelliteInfo > & getSatellites () const noexcept
 
std::size_t getSatelliteCount () const noexcept
 
const SatelliteInfogetSatellite (std::size_t index) const noexcept
 
bool hasSignalId () const noexcept
 
std::optional< unsigned int > getSignalId () const noexcept
 
std::string getStringContent (bool verbose) const noexcept override
 Returns a human-readable string representation of the message content.
 
bool operator== (const GSV &other) const noexcept
 
- Public Member Functions inherited from nmealib::nmea0183::Message0183
 Message0183 (const Message0183 &)=default
 Copy constructor.
 
Message0183operator= (const Message0183 &)=default
 Copy assignment operator.
 
 Message0183 (Message0183 &&) noexcept=default
 Move constructor.
 
Message0183operator= (Message0183 &&) noexcept=default
 Move assignment operator.
 
 ~Message0183 () override=default
 Destructor.
 
std::unique_ptr< nmealib::Messageclone () const override
 Creates a polymorphic deep copy of this Message0183.
 
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
 
Messageoperator= (const Message &)=default
 
 Message (Message &&) noexcept=default
 
Messageoperator= (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< Message0183create (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_ {}
 

Detailed Description

Definition at line 18 of file gsv.h.

Constructor & Destructor Documentation

◆ GSV() [1/3]

nmealib::nmea0183::GSV::GSV ( std::string  talkerId,
unsigned int  totalSentences,
unsigned int  sentenceNumber,
unsigned int  satellitesInView,
std::vector< SatelliteInfo satellites,
std::optional< unsigned int >  signalId = std::nullopt 
)

Definition at line 124 of file gsv.cpp.

◆ GSV() [2/3]

nmealib::nmea0183::GSV::GSV ( const GSV )
default

◆ GSV() [3/3]

nmealib::nmea0183::GSV::GSV ( GSV &&  )
defaultnoexcept

◆ ~GSV()

nmealib::nmea0183::GSV::~GSV ( )
overridedefault

Member Function Documentation

◆ clone()

std::unique_ptr< nmealib::Message > nmealib::nmea0183::GSV::clone ( ) const
overridevirtual

Creates a polymorphic deep copy of this message.

Returns
std::unique_ptr<Message> A unique pointer to the cloned message.

Implements nmealib::Message.

Definition at line 142 of file gsv.cpp.

◆ getSatellite()

const GSV::SatelliteInfo * nmealib::nmea0183::GSV::getSatellite ( std::size_t  index) const
noexcept

Definition at line 219 of file gsv.cpp.

◆ getSatelliteCount()

std::size_t nmealib::nmea0183::GSV::getSatelliteCount ( ) const
noexcept

Definition at line 215 of file gsv.cpp.

◆ getSatellites()

const std::vector< GSV::SatelliteInfo > & nmealib::nmea0183::GSV::getSatellites ( ) const
noexcept

Definition at line 211 of file gsv.cpp.

◆ getSatellitesInView()

unsigned int nmealib::nmea0183::GSV::getSatellitesInView ( ) const
noexcept

Definition at line 207 of file gsv.cpp.

◆ getSentenceNumber()

unsigned int nmealib::nmea0183::GSV::getSentenceNumber ( ) const
noexcept

Definition at line 203 of file gsv.cpp.

◆ getSignalId()

std::optional< unsigned int > nmealib::nmea0183::GSV::getSignalId ( ) const
noexcept

Definition at line 230 of file gsv.cpp.

◆ getStringContent()

std::string nmealib::nmea0183::GSV::getStringContent ( bool  verbose) const
overridevirtualnoexcept

Returns a human-readable string representation of the message content.

Parameters
verboseSelects whether to print a one-liner or a more detailed multi-line string with field names and values.
Returns
std::string The string representation of the message content

Reimplemented from nmealib::nmea0183::Message0183.

Definition at line 146 of file gsv.cpp.

◆ getTotalSentences()

unsigned int nmealib::nmea0183::GSV::getTotalSentences ( ) const
noexcept

Definition at line 199 of file gsv.cpp.

◆ hasSignalId()

bool nmealib::nmea0183::GSV::hasSignalId ( ) const
noexcept

Definition at line 226 of file gsv.cpp.

◆ operator=() [1/2]

GSV & nmealib::nmea0183::GSV::operator= ( const GSV )
default

◆ operator=() [2/2]

GSV & nmealib::nmea0183::GSV::operator= ( GSV &&  )
defaultnoexcept

◆ operator==()

bool nmealib::nmea0183::GSV::operator== ( const GSV other) const
noexcept

Definition at line 234 of file gsv.cpp.

Friends And Related Symbol Documentation

◆ MessageRegistry

friend class MessageRegistry
friend

Definition at line 82 of file gsv.h.

◆ Nmea0183Factory

friend class Nmea0183Factory
friend

Definition at line 81 of file gsv.h.


The documentation for this class was generated from the following files: