MDPHeader Class Reference

#include <MDPHeader.hpp>

Inheritance diagram for MDPHeader:

Inheritance graph
[legend]
Collaboration diagram for MDPHeader:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class contains header information for all data types transmitted by receiver meeting the MDP specification.

Definition at line 73 of file MDPHeader.hpp.

Public Member Functions

 MDPHeader () throw ()
bool isValid () const
virtual bool isData () const
 This class is "data" so this function always returns "true".
virtual std::string encode () const throw ()
 Encode this object to a string.
virtual void decode (std::string str) throw ()
 Decode this object from a string.
virtual std::string getName () const
 Simple accessors for various static thangs.
void dump (std::ostream &out) const throw ()
 Dump some debugging information to the given ostream.
void setCRC (std::string &str) const throw (FFStreamError)
 Compute the CRC over the string and set the CRC in that string and in the header.
void checkCRC (std::string str) throw ()
 Checks the crc of the message and set crc_err if it fails.
void readHeader (MDPStream &s) throw (FFStreamError, EndOfFile)
std::string readBody (MDPStream &s) throw (FFStreamError, EndOfFile)

Public Attributes

unsigned short id
 Identifies this data's type.
gpstk::CommonTime time
 The time associated with this message.
unsigned short freshnessCount
 A message counter.
unsigned short length
 number of bytes in this message (includes the length of the header)
unsigned short crc
 the 16 bit CCITT crc covering the header and body of the message

Static Public Attributes

const uint16_t myLength = 16
 = 16
const uint16_t frameWord = 0x9c9c
 = 0x9c9c
int debugLevel = 0
bool hexDump = false

Protected Member Functions

virtual void reallyPutRecord (FFStream &s) const throw (std::exception, StringUtils::StringException, FFStreamError)
 Does the actual writing from the stream into this FFData object.
virtual void reallyGetRecord (FFStream &s) throw (std::exception, StringUtils::StringException, FFStreamError, EndOfFile)
 Does the actual reading from the stream into this FFData object.


Constructor & Destructor Documentation

MDPHeader  )  throw () [inline]
 

Definition at line 76 of file MDPHeader.hpp.


Member Function Documentation

void checkCRC std::string  str  )  throw ()
 

Checks the crc of the message and set crc_err if it fails.

Definition at line 182 of file MDPHeader.cpp.

References gpstk::BinUtils::computeCRC().

Referenced by FFIdentifier::FFIdentifier().

void decode std::string  str  )  throw () [virtual]
 

Decode this object from a string.

Parameters:
str the string to read from.
Note:
Decoded data is *NOT* removed from the string.

Reimplemented in MDPNavSubframe, MDPObsEpoch, MDPPVTSolution, and MDPSelftestStatus.

Definition at line 104 of file MDPHeader.cpp.

References gpstk::dump().

void dump std::ostream &  out  )  const throw () [virtual]
 

Dump some debugging information to the given ostream.

Parameters:
out the ostream to write to

Reimplemented from FFData.

Reimplemented in MDPNavSubframe, MDPObsEpoch, MDPPVTSolution, and MDPSelftestStatus.

Definition at line 431 of file MDPHeader.cpp.

References gpstk::printTime().

Referenced by MDPHeader::reallyGetRecord().

string encode  )  const throw () [virtual]
 

Encode this object to a string.

Returns:
this object as a string.

Reimplemented in MDPNavSubframe, MDPObsEpoch, MDPPVTSolution, and MDPSelftestStatus.

Definition at line 76 of file MDPHeader.cpp.

virtual std::string getName  )  const [inline, virtual]
 

Simple accessors for various static thangs.

Reimplemented in MDPNavSubframe, MDPObsEpoch, MDPPVTSolution, and MDPSelftestStatus.

Definition at line 97 of file MDPHeader.hpp.

virtual bool isData void   )  const [inline, virtual]
 

This class is "data" so this function always returns "true".

Reimplemented from FFData.

Definition at line 83 of file MDPHeader.hpp.

bool isValid void   )  const [inline]
 

Definition at line 80 of file MDPHeader.hpp.

string readBody MDPStream s  )  throw (FFStreamError, EndOfFile)
 

Definition at line 312 of file MDPHeader.cpp.

Referenced by FFIdentifier::FFIdentifier().

void readHeader MDPStream s  )  throw (FFStreamError, EndOfFile)
 

Definition at line 244 of file MDPHeader.cpp.

References FFBinaryStream::getData(), MDPStream::header, gpstk::StringUtils::hexDumpData(), gpstk::BinUtils::netToHost(), MDPStream::rawHeader, and MDPStream::streamState.

void reallyGetRecord FFStream s  )  throw (std::exception, StringUtils::StringException, FFStreamError, EndOfFile) [protected, virtual]
 

Does the actual reading from the stream into this FFData object.

Implements FFData.

Definition at line 345 of file MDPHeader.cpp.

References gpstk::dump(), MDPHeader::dump(), MDPStream::header, gpstk::StringUtils::hexDumpData(), MDPHeader::id, MDPHeader::length, MDPStream::rawHeader, FFStream::recordNumber, and MDPStream::streamState.

void reallyPutRecord FFStream s  )  const throw (std::exception, StringUtils::StringException, FFStreamError) [protected, virtual]
 

Does the actual writing from the stream into this FFData object.

Implements FFData.

Definition at line 214 of file MDPHeader.cpp.

References GPSTK_THROW, and gpstk::StringUtils::hexDumpData().

void setCRC std::string &  str  )  const throw (FFStreamError)
 

Compute the CRC over the string and set the CRC in that string and in the header.

Definition at line 154 of file MDPHeader.cpp.

References gpstk::StringUtils::asString(), gpstk::BinUtils::computeCRC(), GPSTK_THROW, and gpstk::BinUtils::hostToNet().


Member Data Documentation

unsigned short crc [mutable]
 

the 16 bit CCITT crc covering the header and body of the message

Definition at line 118 of file MDPHeader.hpp.

int debugLevel = 0 [static]
 

Definition at line 70 of file MDPHeader.cpp.

const uint16_t frameWord = 0x9c9c [static]
 

= 0x9c9c

Definition at line 63 of file MDPHeader.cpp.

unsigned short freshnessCount
 

A message counter.

Definition at line 113 of file MDPHeader.hpp.

bool hexDump = false [static]
 

Definition at line 73 of file MDPHeader.cpp.

unsigned short id
 

Identifies this data's type.

Definition at line 111 of file MDPHeader.hpp.

Referenced by MDPHeader::reallyGetRecord().

unsigned short length [mutable]
 

number of bytes in this message (includes the length of the header)

Definition at line 117 of file MDPHeader.hpp.

Referenced by MDPHeader::reallyGetRecord().

const uint16_t myLength = 16 [static]
 

= 16

Reimplemented in MDPNavSubframe, MDPObsEpoch, MDPPVTSolution, and MDPSelftestStatus.

Definition at line 62 of file MDPHeader.cpp.

gpstk::CommonTime time
 

The time associated with this message.

Definition at line 112 of file MDPHeader.hpp.

Referenced by gpstk::makeMDPEpoch(), gpstk::makeMDPObsEpoch(), gpstk::makeMDPPVTSolution(), and gpstk::operator>>().


The documentation for this class was generated from the following files:
Generated on Sun May 19 03:31:45 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1