DUNE: Uniform Navigational Environment  2.6.1
DUNE::Parsers::NMEAReader Class Reference

Detailed Description

NMEA Sentence reader is a simple NMEA parser capable of validating and converting sentence fields.

Public Member Functions

 NMEAReader (const std::string &sentence)
 
 ~NMEAReader (void)
 
const char * code (void) const
 
NMEAReaderskip (void)
 
NMEAReaderoperator>> (bool &value)
 
NMEAReaderoperator>> (int &value)
 
NMEAReaderoperator>> (unsigned &value)
 
NMEAReaderoperator>> (float &value)
 
NMEAReaderoperator>> (double &value)
 
NMEAReaderoperator>> (std::string &value)
 
bool eos (void)
 

Constructor & Destructor Documentation

DUNE::Parsers::NMEAReader::NMEAReader ( const std::string &  sentence)

Construct a NMEA Reader object.

The code of the sentence (ie. first field of the sentence, next to the dollar sign) will be extracted and accessible through the code() member function. If the sentence contains a checksum it will be validated.

Parameters
sentencestring with NMEA sentence.
DUNE::Parsers::NMEAReader::~NMEAReader ( void  )

Destructor.

Member Function Documentation

const char* DUNE::Parsers::NMEAReader::code ( void  ) const
inline

Retrieve sentence code.

Returns
sentence code.
bool DUNE::Parsers::NMEAReader::eos ( void  )

Check if we reached the end of sentence and there are no more fields to extract.

Returns
true of there are no more fields to extract, false otherwise.
NMEAReader & DUNE::Parsers::NMEAReader::operator>> ( bool &  value)

Convert the next field in the input stream to boolean.

Parameters
valueoutput variable.
Returns
current object.
NMEAReader & DUNE::Parsers::NMEAReader::operator>> ( int &  value)

Convert the next field in the input stream to integer.

Parameters
valueoutput variable.
Returns
current object.
NMEAReader & DUNE::Parsers::NMEAReader::operator>> ( unsigned &  value)

Convert the next field in the input stream to unsigned integer.

Parameters
valueoutput variable.
Returns
current object.
NMEAReader & DUNE::Parsers::NMEAReader::operator>> ( float &  value)

Convert the next field in the input stream to float.

Parameters
valueoutput variable.
Returns
current object.
NMEAReader & DUNE::Parsers::NMEAReader::operator>> ( double &  value)

Convert the next field in the input stream to double.

Parameters
valueoutput variable.
Returns
current object.
NMEAReader & DUNE::Parsers::NMEAReader::operator>> ( std::string &  value)

Read the next field in the input stream verbatim.

Parameters
valueoutput variable.
Returns
current object.
NMEAReader & DUNE::Parsers::NMEAReader::skip ( void  )

Skip the next field in the input stream.

Returns
current object.
Collaboration diagram for DUNE::Parsers::NMEAReader:
Collaboration graph