BinexData::MGFZI Class Reference

#include <BinexData.hpp>

List of all members.


Detailed Description

A signed integer stored using 1, 2, 3, 4, 5, 6, 7, or 8 bytes to represent integers from about -1.15292e18 to +1.15292e18 using a modified version of a compression scheme developed by GFZ, plus using "special" numbers to flag certain conditions, such as using the 1-byte MFGZI to store "-0" to indicate "no value.".

Definition at line 284 of file BinexData.hpp.

Public Member Functions

 MGFZI ()
 Default constructor - sets value to 0.
 MGFZI (const MGFZI &other)
 Copy constructor.
 throw (FFStreamError)
 Constructor with a long long initialization value.
MGFZIoperator= (const MGFZI &right)
 Copies another MGFZI.
bool operator== (const MGFZI &other) const
 Compares two MGFZI's for equality.
bool operator!= (const MGFZI &other) const
 Compares two MGFZI's for inequality.
bool operator< (const MGFZI &other) const
 Returns whether this MGFZI is less than the other.
bool operator<= (const MGFZI &other) const
 Returns whether this MGFZI is less than or equal to the other.
bool operator> (const MGFZI &other) const
 Returns whether this MGFZI is greater than the other.
bool operator>= (const MGFZI &other) const
 Returns whether this MGFZI is greater than or equal to the other.
 operator long long () const
 Returns the value of the MGFZI as a long long.
size_t getSize () const
 Returns the number of bytes required to represent the MGFZI.
size_t decode (const std::string &inBuffer, size_t offset=0, bool littleEndian=false) throw (FFStreamError)
 Attempts to decode a valid MGFZI from the contents of inBuffer.
size_t encode (std::string &outBuffer, size_t offset=0, bool littleEndian=false) const
 Converts the MGFZI to a series of bytes placed in outBuffer.
size_t read (std::istream &strm, std::string *outBuffer=NULL, size_t offset=0, bool reverseBytes=false, bool littleEndian=false) throw (FFStreamError)
 Attempts to read a valid MGFZI from the specified input stream.
size_t write (std::ostream &strm, std::string *outBuffer=NULL, size_t offset=0, bool reverseBytes=false, bool littleEndian=false) const throw (FFStreamError)
 Attempts to write the MGFZI to the specified output stream.

Static Public Attributes

const long long MIN_VALUE = -1157442765409226759LL
const long long MAX_VALUE = 1157442765409226759LL
const unsigned char MAX_BYTES = 8

Protected Attributes

long long value
size_t size


Constructor & Destructor Documentation

MGFZI  ) 
 

Default constructor - sets value to 0.

Definition at line 345 of file BinexData.cpp.

References BinexData::MGFZI::size, and BinexData::MGFZI::value.

MGFZI const MGFZI other  )  [inline]
 

Copy constructor.

Definition at line 300 of file BinexData.hpp.


Member Function Documentation

size_t decode const std::string &  inBuffer,
size_t  offset = 0,
bool  littleEndian = false
throw (FFStreamError)
 

Attempts to decode a valid MGFZI from the contents of inBuffer.

The contents of inBuffer are assumed to be in normal order (i.e. not reversed) but may be either big or little endian.

Parameters:
inBuffer Sequence of bytes to decode
offset Offset into inBuffer at which to decode
littleEndian Byte order of the encoded bytes
Returns:
Number of bytes decoded

Definition at line 412 of file BinexData.cpp.

References GPSTK_THROW, BinexData::parseBuffer(), and BinexData::reverseBuffer().

size_t encode std::string &  outBuffer,
size_t  offset = 0,
bool  littleEndian = false
const
 

Converts the MGFZI to a series of bytes placed in outBuffer.

The bytes are output in normal order (i.e. not reversed) but may encode in either big or little endian format.

Parameters:
outBuffer Sequence of encoded bytes
offset Offset into outBuffer at which to encode
littleEndian Byte order of the encoded bytes
Returns:
Number of bytes used to encode

Definition at line 598 of file BinexData.cpp.

References GPSTK_THROW, BinexData::reverseBuffer(), BinexData::MGFZI::size, and BinexData::MGFZI::value.

size_t getSize  )  const [inline]
 

Returns the number of bytes required to represent the MGFZI.

A size of 0 indicates an invalid or uninitialized MGFZI.

Definition at line 390 of file BinexData.hpp.

operator long long  )  const [inline]
 

Returns the value of the MGFZI as a long long.

Definition at line 380 of file BinexData.hpp.

bool operator!= const MGFZI other  )  const [inline]
 

Compares two MGFZI's for inequality.

Definition at line 335 of file BinexData.hpp.

References BinexData::MGFZI::value.

bool operator< const MGFZI other  )  const [inline]
 

Returns whether this MGFZI is less than the other.

Definition at line 344 of file BinexData.hpp.

References BinexData::MGFZI::value.

bool operator<= const MGFZI other  )  const [inline]
 

Returns whether this MGFZI is less than or equal to the other.

Definition at line 353 of file BinexData.hpp.

References BinexData::MGFZI::value.

MGFZI& operator= const MGFZI right  )  [inline]
 

Copies another MGFZI.

Definition at line 315 of file BinexData.hpp.

References BinexData::MGFZI::size, and BinexData::MGFZI::value.

bool operator== const MGFZI other  )  const [inline]
 

Compares two MGFZI's for equality.

Definition at line 326 of file BinexData.hpp.

References BinexData::MGFZI::value.

bool operator> const MGFZI other  )  const [inline]
 

Returns whether this MGFZI is greater than the other.

Definition at line 362 of file BinexData.hpp.

References BinexData::MGFZI::value.

bool operator>= const MGFZI other  )  const [inline]
 

Returns whether this MGFZI is greater than or equal to the other.

Definition at line 371 of file BinexData.hpp.

References BinexData::MGFZI::value.

size_t read std::istream &  strm,
std::string *  outBuffer = NULL,
size_t  offset = 0,
bool  reverseBytes = false,
bool  littleEndian = false
throw (FFStreamError)
 

Attempts to read a valid MGFZI from the specified input stream.

The stream can be in reverse order and can be big or little endian. If the method succeeds, the number of bytes used to contruct the MGFZI can be determined by calling the getSize() method.

Parameters:
strm Stream from which to read
outBuffer Optional buffer to receive copy of raw input
reverseBytes Optional flag indicating whether the input bytes are reversed
littleEndian Optional flag indicating byte order of input

Definition at line 791 of file BinexData.cpp.

References GPSTK_THROW, and BinexData::reverseBuffer().

throw FFStreamError   ) 
 

Constructor with a long long initialization value.

size_t write std::ostream &  strm,
std::string *  outBuffer = NULL,
size_t  offset = 0,
bool  reverseBytes = false,
bool  littleEndian = false
const throw (FFStreamError)
 

Attempts to write the MGFZI to the specified output stream.

The stream can be output in reverse order and can be big or little endian. The method fails if the entire MGFZI cannot be written to the stream.

Parameters:
strm Stream in which to write
outBuffer Optional buffer to receive copy of raw ouput
reverseBytes Optional flag indicating whether the ouput bytes should be reversed
littleEndian Optional flag indicating byte order of output

Definition at line 855 of file BinexData.cpp.

References GPSTK_THROW, and BinexData::reverseBuffer().


Member Data Documentation

const unsigned char MAX_BYTES = 8 [static]
 

Definition at line 290 of file BinexData.hpp.

const long long MAX_VALUE = 1157442765409226759LL [static]
 

Definition at line 289 of file BinexData.hpp.

const long long MIN_VALUE = -1157442765409226759LL [static]
 

Definition at line 288 of file BinexData.hpp.

size_t size [protected]
 

Definition at line 466 of file BinexData.hpp.

Referenced by BinexData::MGFZI::encode(), BinexData::getMessageLength(), BinexData::MGFZI::MGFZI(), and BinexData::MGFZI::operator=().

long long value [protected]
 

Definition at line 465 of file BinexData.hpp.

Referenced by BinexData::MGFZI::encode(), BinexData::MGFZI::MGFZI(), BinexData::MGFZI::operator!=(), BinexData::MGFZI::operator<(), BinexData::MGFZI::operator<=(), BinexData::MGFZI::operator=(), BinexData::MGFZI::operator==(), BinexData::MGFZI::operator>(), and BinexData::MGFZI::operator>=().


The documentation for this class was generated from the following files:
Generated on Thu Feb 9 03:31:33 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1