#include <BinexData.hpp>
Inheritance diagram for BinexData:


binex_test.cpp for an example.
Definition at line 52 of file BinexData.hpp.
Public Types | |
| enum | recordFlagsEnum { eReverseReadable = 0x10, eBigEndian = 0x20, eEnhancedCRC = 0x08 } |
Public Member Functions | |
| BinexData () | |
| Default constructor. | |
| BinexData (const BinexData &other) | |
| Copy constructor. | |
| BinexData (unsigned long recordID, unsigned char recordFlags=DEFAULT_RECORD_FLAGS) throw () | |
| Convenience constructor. | |
| BinexData & | operator= (const BinexData &right) |
| Copies another BinexData object. | |
| virtual | ~BinexData () |
| Destructor. | |
| virtual bool | isData (void) const |
| BinexData is "data" so this function always returns true. | |
| virtual void | dump (std::ostream &s) const |
| A debug output function. | |
| bool | operator== (const BinexData &b) const |
| Compares two BinexData objects. | |
| unsigned char | getRecordFlags () const |
| Returns flags indicating endianness, reversability, and CRC-mode of the current record. | |
| BinexData & | setRecordFlags (unsigned char flags=DEFAULT_RECORD_FLAGS) |
| Sets the endianness, reversability, and CRC-mode of the record. | |
| unsigned long | getRecordID () const |
| Returns the ID of this BINEX record. | |
| BinexData & | setRecordID (unsigned long id) throw (FFStreamError) |
| Sets the ID of this BINEX record. | |
| size_t | getRecordSize () const |
| Returns the number of bytes required to represent the entire record (based on the record's current contents). | |
| BinexData & | clearMessage () |
| Remove all data from the record message buffer. | |
| BinexData & | ensureMessageCapacity (size_t cap) throw (FFStreamError) |
| Reserves a number of bytes for storage of the record message. | |
| size_t | getMessageLength () const |
| Returns the length of the data in the record message buffer (which is separate from the record message buffer's capacity). | |
| size_t | getMessageCapacity () const |
| Returns the capacity of the record message buffer (which is separate from the lenth of the data in the buffer). | |
| const std::string & | getMessageData () const |
| Returns a pointer to the raw message data. | |
| BinexData & | updateMessageData (size_t &offset, const UBNXI &data) throw (FFStreamError, InvalidParameter) |
| Updates the message buffer with the specified UBNXI. | |
| BinexData & | updateMessageData (size_t &offset, const MGFZI &data) throw (FFStreamError, InvalidParameter) |
| Updates the message buffer with the specified MGFZI. | |
| BinexData & | updateMessageData (size_t &offset, const std::string &data, size_t size) throw (FFStreamError, InvalidParameter) |
| Updates the message buffer with the specified raw data. | |
| BinexData & | updateMessageData (size_t &offset, const char *data, size_t size) throw (FFStreamError, InvalidParameter) |
| Updates the message buffer with the specified raw data. | |
| template<class T> | |
| BinexData & | updateMessageData (size_t &offset, const T &data, size_t size) throw (FFStreamError, InvalidParameter) |
| Updates the message buffer with the specified data. | |
| void | extractMessageData (size_t &offset, UBNXI &data) throw (FFStreamError, InvalidParameter) |
| Extacts a UBNXI from the message buffer. | |
| void | extractMessageData (size_t &offset, MGFZI &data) throw (FFStreamError, InvalidParameter) |
| Extacts a MGFZI from the message buffer. | |
| void | extractMessageData (size_t &offset, std::string &data, size_t size) const throw (InvalidParameter) |
| Extacts raw data from the message buffer. | |
| template<class T> | |
| void | extractMessageData (size_t &offset, T &data, size_t size) const throw (FFStreamError, InvalidParameter) |
| Extacts data from the message buffer. | |
Static Public Attributes | |
| const bool | nativeLittleEndian = true |
| const unsigned long | INVALID_RECORD_ID = 0xFFFFFFFF |
| const unsigned char | DEFAULT_RECORD_FLAGS = 0x20 |
| const unsigned char | VALID_RECORD_FLAGS = 0x38 |
Protected Member Functions | |
| virtual void | reallyPutRecord (FFStream &s) const throw (std::exception, FFStreamError, StringUtils::StringException) |
| Writes the BINEX data to the file stream formatted correctly. | |
| virtual void | reallyGetRecord (FFStream &s) throw (std::exception, FFStreamError, StringUtils::StringException) |
| This function retrieves a BINEX record from the given FFStream. | |
| void | getCRC (const std::string &head, const std::string &message, std::string &crc) const |
| size_t | getCRCLength (size_t crcDataLen) const |
| Returns the number of bytes required to store the record's CRC based on the record's current contents. | |
| bool | isHeadSyncByteValid (unsigned char headSync, unsigned char &expectedTailSync) const |
| Determines whether the supplied head sync byte is valid an returns an expected correosponding tail sync byte if appropriate. | |
| bool | isTailSyncByteValid (unsigned char tailSync, unsigned char &expectedHeadSync) const |
| Determines whether the supplied tail sync byte is valid an returns an expected correosponding head sync byte. | |
Static Protected Member Functions | |
| unsigned long long | parseBuffer (const std::string &buffer, size_t offset, size_t size) throw (FFStreamError) |
| Converts a raw sequence of bytes into an unsigned long long integer. | |
| void | reverseBuffer (unsigned char *buffer, size_t bufferLength) |
| Reverses the order of the first bufferLength bytes in the specified buffer. | |
| void | reverseBuffer (std::string &buffer, size_t offset=0, size_t n=std::string::npos) |
| Reverses the order of the first bufferLength bytes in the specified buffer. | |
Protected Attributes | |
Attributes | |
| unsigned char | syncByte |
| Flags for endianness, CRC, etc. | |
| unsigned long | recID |
| Record ID. | |
| std::string | msg |
| Record message (opaque). | |
|
|
Definition at line 72 of file BinexData.hpp. |
|
|
Default constructor.
Definition at line 900 of file BinexData.cpp. References BinexData::recID, and BinexData::setRecordFlags(). |
|
|
Copy constructor.
Definition at line 908 of file BinexData.cpp. |
|
||||||||||||
|
Convenience constructor.
Definition at line 915 of file BinexData.cpp. |
|
|
Destructor.
Definition at line 499 of file BinexData.hpp. |
|
|
Remove all data from the record message buffer.
Definition at line 1006 of file BinexData.cpp. References BinexData::msg. |
|
|
A debug output function.
Reimplemented from FFData. Definition at line 1697 of file BinexData.cpp. References BinexData::msg, BinexData::recID, and BinexData::syncByte. |
|
|
Reserves a number of bytes for storage of the record message. This number can grow as data is added to the message, but an adequate initial number results in greater efficiency. The actual length of the data in the message buffer is a separate and strictly smaller amount. Definition at line 1015 of file BinexData.cpp. References GPSTK_THROW. |
|
||||||||||||||||
|
Extacts data from the message buffer. The location within the message buffer is set by the offset parameter, and the size of the data to extract is set by the size parameter. This method checks to ensure that the value of the size parameter does not exceed sizeof(T) and that all data is extracted from within the message buffer. After extracting data from the message buffer, the value of the offset parameter is updated by size to reference the next available byte in the message buffer.
Definition at line 813 of file BinexData.hpp. References GPSTK_THROW, and gpstk::BinUtils::twiddle(). |
|
||||||||||||||||
|
Extacts raw data from the message buffer. The location within the message buffer is set by the offset parameter, and the size of the data to extract is set by the size parameter. This method checks to ensure that all data is extracted from within the message buffer. After extracting data from the message buffer, the value of the offset parameter is updated by size to reference the next available byte in the message buffer.
Definition at line 1134 of file BinexData.cpp. References GPSTK_THROW. |
|
||||||||||||
|
Extacts a MGFZI from the message buffer. The location within the message buffer is set by the offset parameter. After extracting the MGFZI from the message buffer, the value of the offset parameter is updated by the MGFZI's size to reference the next available byte in the message buffer.
Definition at line 1115 of file BinexData.cpp. References BinexData::UBNXI::decode(), and GPSTK_THROW. |
|
||||||||||||
|
Extacts a UBNXI from the message buffer. The location within the message buffer is set by the offset parameter. After extracting the UBNXI from the message buffer, the value of the offset parameter is updated by the UBNXI's size to reference the next available byte in the message buffer.
Definition at line 1096 of file BinexData.cpp. References BinexData::UBNXI::decode(), and GPSTK_THROW. |
|
||||||||||||||||
|
Definition at line 1413 of file BinexData.cpp. References gpstk::BinUtils::computeCRC(), CRCParam::initial, BinexData::UBNXI::size, BinexData::syncByte, and gpstk::BinUtils::twiddle(). |
|
|
Returns the number of bytes required to store the record's CRC based on the record's current contents.
Definition at line 1517 of file BinexData.cpp. References BinexData::syncByte. Referenced by BinexData::getRecordSize(). |
|
|
Returns the capacity of the record message buffer (which is separate from the lenth of the data in the buffer).
Definition at line 610 of file BinexData.hpp. |
|
|
Returns a pointer to the raw message data. Note that the format of the data is dependent upon the record flags at the time the data was added to the message. Definition at line 622 of file BinexData.hpp. |
|
|
Returns the length of the data in the record message buffer (which is separate from the record message buffer's capacity).
Definition at line 598 of file BinexData.hpp. References BinexData::MGFZI::size. |
|
|
Returns flags indicating endianness, reversability, and CRC-mode of the current record. The individual flags can be extracted from the returned value by AND-ing with values from recordFlagsEnum. Definition at line 530 of file BinexData.hpp. |
|
|
Returns the ID of this BINEX record.
Definition at line 555 of file BinexData.hpp. |
|
|
Returns the number of bytes required to represent the entire record (based on the record's current contents).
Definition at line 977 of file BinexData.cpp. References BinexData::getCRCLength(), BinexData::UBNXI::getSize(), BinexData::msg, BinexData::recID, BinexData::UBNXI::size, and BinexData::syncByte. |
|
|
BinexData is "data" so this function always returns true.
Reimplemented from FFData. Definition at line 505 of file BinexData.hpp. |
|
||||||||||||
|
Determines whether the supplied head sync byte is valid an returns an expected correosponding tail sync byte if appropriate.
Definition at line 1562 of file BinexData.cpp. |
|
||||||||||||
|
Determines whether the supplied tail sync byte is valid an returns an expected correosponding head sync byte.
Definition at line 1598 of file BinexData.cpp. |
|
|
Copies another BinexData object.
Definition at line 926 of file BinexData.cpp. References BinexData::msg, BinexData::recID, and BinexData::syncByte. |
|
|
Compares two BinexData objects.
Definition at line 935 of file BinexData.cpp. References BinexData::msg, BinexData::recID, and BinexData::syncByte. |
|
||||||||||||||||
|
Converts a raw sequence of bytes into an unsigned long long integer.
Definition at line 1627 of file BinexData.cpp. References GPSTK_THROW. Referenced by BinexData::MGFZI::decode(). |
|
|
This function retrieves a BINEX record from the given FFStream. If an error is encountered in reading from the stream, the stream is returned to its original position and its fail-bit is set.
Implements FFData. Definition at line 1244 of file BinexData.cpp. References BinexData::UBNXI::decode(), GPSTK_RETHROW, GPSTK_THROW, BinexData::UBNXI::read(), and BinexData::UBNXI::size. |
|
|
Writes the BINEX data to the file stream formatted correctly.
Implements FFData. Definition at line 1154 of file BinexData.cpp. References BinexData::UBNXI::encode(), BinexData::UBNXI::getSize(), GPSTK_THROW, and BinexData::UBNXI::size. |
|
||||||||||||||||
|
Reverses the order of the first bufferLength bytes in the specified buffer.
Definition at line 1671 of file BinexData.cpp. References GPSTK_THROW. |
|
||||||||||||
|
Reverses the order of the first bufferLength bytes in the specified buffer.
Definition at line 1657 of file BinexData.cpp. Referenced by BinexData::MGFZI::decode(), BinexData::MGFZI::encode(), BinexData::UBNXI::encode(), BinexData::MGFZI::read(), BinexData::MGFZI::write(), and BinexData::UBNXI::write(). |
|
|
Sets the endianness, reversability, and CRC-mode of the record. The "flags" paramater should be set by OR-ing together values from recordFlagsEnum enumeration. Invalid bits in "flag" are silently ignored. WARNING: Since the record flags determine how data is stored in the record message buffer, altering the record flags after data has been placed in the message buffer could result in misinterpretation of that data. Doing so is therefore highly discouraged. Definition at line 962 of file BinexData.cpp. References BinexData::syncByte. Referenced by BinexData::BinexData(). |
|
|
Sets the ID of this BINEX record.
Definition at line 945 of file BinexData.cpp. References GPSTK_THROW. |
|
||||||||||||||||
|
Updates the message buffer with the specified data. The location within the message buffer is set by the offset parameter, and the size of the data to copy is set by the size parameter. This method checks to ensure that the value of the size parameter does not exceed sizeof(T) and that all data fits within the message buffer. After updating the message buffer, the value of the offset parameter is updated by size to reference the next available byte in the message buffer.
Definition at line 716 of file BinexData.hpp. References GPSTK_THROW, and gpstk::BinUtils::twiddle(). |
|
||||||||||||||||
|
Updates the message buffer with the specified raw data. The location within the message buffer is set by the offset parameter, and the size of the data to copy is set by the size parameter. After updating the message buffer, the value of the offset parameter is updated by size to reference the next available byte in the message buffer.
Definition at line 1082 of file BinexData.cpp. |
|
||||||||||||||||
|
Updates the message buffer with the specified raw data. The location within the message buffer is set by the offset parameter, and the size of the data to copy is set by the size parameter. After updating the message buffer, the value of the offset parameter is updated by size to reference the next available byte in the message buffer.
Definition at line 1060 of file BinexData.cpp. References GPSTK_THROW. |
|
||||||||||||
|
Updates the message buffer with the specified MGFZI. The location within the message buffer is set by the offset parameter. This method checks to ensure that all data fits within the message buffer. After updating the message buffer, the value of the offset parameter is updated by size to reference the next available byte in the message buffer.
Definition at line 1046 of file BinexData.cpp. References BinexData::UBNXI::encode(). |
|
||||||||||||
|
Updates the message buffer with the specified UBNXI. The location within the message buffer is set by the offset parameter. This method checks to ensure that all data fits within the message buffer. After updating the message buffer, the value of the offset parameter is updated by size to reference the next available byte in the message buffer.
Definition at line 1032 of file BinexData.cpp. References BinexData::UBNXI::encode(). |
|
|
Definition at line 65 of file BinexData.hpp. |
|
|
Definition at line 63 of file BinexData.hpp. |
|
|
Record message (opaque).
Definition at line 943 of file BinexData.hpp. Referenced by BinexData::clearMessage(), BinexData::dump(), BinexData::getRecordSize(), BinexData::operator=(), and BinexData::operator==(). |
|
|
Definition at line 58 of file BinexData.hpp. |
|
|
Record ID.
Definition at line 942 of file BinexData.hpp. Referenced by BinexData::BinexData(), BinexData::dump(), BinexData::getRecordSize(), BinexData::operator=(), and BinexData::operator==(). |
|
|
Flags for endianness, CRC, etc.
Definition at line 941 of file BinexData.hpp. Referenced by BinexData::dump(), BinexData::getCRC(), BinexData::getCRCLength(), BinexData::getRecordSize(), BinexData::operator=(), BinexData::operator==(), and BinexData::setRecordFlags(). |
|
|
Definition at line 66 of file BinexData.hpp. |
1.3.9.1