This is the base class for all Formatted File Data (FFData). The data in FFStream objects are read/written into classes derived from FFData. There are two interfaces for this - one with the operator<<() and operator>>() and the equivalent with getRecord() and putRecord().
Classes that derive from this should override the reallyGetRecord() and reallyPutRecord() functions where the actual reading and writing of the data should go as well as the isHeader() or isData() functions as appropriate for the data type. Overriding dump() for debugging purposes is highly suggested.
All FFData derived classes should have all of their members defined public. These are meant to be simple container classes for reading, writing, and manipulating file data. Any conversion of data types should be made in constructors or cast operators. For all FFData objects, any internal time representation for the data should be called time
to ensure consistency between classes.
Finally, for the sake of organization of the inheritence and dependency trees, all related file data classes (i.e. RinexObsData and RinexObsHeader) should derive from a common base (i.e. RinexObsBase).
Definition at line 87 of file FFData.hpp.
#include <FFData.hpp>
Public Member Functions | |
virtual void | dump (std::ostream &s) const |
void | getRecord (FFStream &s) |
virtual bool | isData () const |
virtual bool | isHeader () const |
void | putRecord (FFStream &s) const |
virtual | ~FFData (void) |
virtual desctuctor More... | |
Protected Member Functions | |
virtual void | reallyGetRecord (FFStream &s)=0 |
virtual void | reallyPutRecord (FFStream &s) const =0 |
Friends | |
class | FFStream |
std::ostream & | operator<< (FFStream &o, const FFData &f) |
std::istream & | operator>> (FFStream &i, FFData &f) |
|
inlinevirtual |
virtual desctuctor
Definition at line 91 of file FFData.hpp.
|
inlinevirtual |
Send debug output to the given stream.
s | a generic output stream |
Reimplemented in gnsstk::SP3Header, gnsstk::Rinex3ClockData, gnsstk::IonexHeader, gnsstk::IonexData, gnsstk::Rinex3ObsHeader, gnsstk::BinexData, gnsstk::RinexObsHeader, gnsstk::RinexClockHeader, gnsstk::Rinex3ObsData, gnsstk::Rinex3NavHeader, gnsstk::YumaData, gnsstk::AntexHeader, gnsstk::RinexObsData, gnsstk::SEMData, gnsstk::RinexMetHeader, gnsstk::RinexClockData, gnsstk::RinexNavData, gnsstk::SEMHeader, gnsstk::Rinex3NavData, gnsstk::RinexMetData, gnsstk::Sinex::Data, gnsstk::YumaHeader, gnsstk::RinexNavHeader, gnsstk::AshtechMBEN, gnsstk::AshtechData, gnsstk::AshtechPBEN, gnsstk::AshtechEPB, and gnsstk::AshtechALB.
Definition at line 121 of file FFData.hpp.
void gnsstk::FFData::getRecord | ( | FFStream & | s | ) |
Retrieve a "record" from the given stream. By default, this won't throw exceptions. You can change this by enabling exceptions with this code:
s | a FFStream-based stream |
StringUtils::StringException | when a StringUtils function fails |
FFStreamError | when exceptions(failbit) is set and a read or formatting error occurs. This also resets the stream to its pre-read position. |
Definition at line 54 of file FFData.cpp.
|
inlinevirtual |
Returns whether or not this class is data. Have your overriding function return the correct value.
Reimplemented in gnsstk::BinexData, gnsstk::RinexMetData, gnsstk::AntexData, gnsstk::IonexData, gnsstk::YumaData, gnsstk::SEMData, gnsstk::SP3Data, gnsstk::RinexObsData, gnsstk::RinexClockData, gnsstk::Rinex3ClockData, gnsstk::Rinex3NavData, gnsstk::RinexNavData, gnsstk::Sinex::Data, and gnsstk::AshtechData.
Definition at line 132 of file FFData.hpp.
|
inlinevirtual |
Returns whether or not this class is a header. Have your overriding function return the correct value.
Reimplemented in gnsstk::RinexClockHeader, gnsstk::RinexMetHeader, gnsstk::Rinex3ObsHeader, gnsstk::RinexObsHeader, gnsstk::IonexHeader, gnsstk::SP3Header, gnsstk::Rinex3ClockHeader, gnsstk::Rinex3NavHeader, gnsstk::AntexHeader, gnsstk::SEMHeader, gnsstk::YumaHeader, and gnsstk::RinexNavHeader.
Definition at line 127 of file FFData.hpp.
void gnsstk::FFData::putRecord | ( | FFStream & | s | ) | const |
Send a "record" to the given stream.
s | a FFStream-based stream |
FFStreamError | |
StringUtils::StringException |
Definition at line 49 of file FFData.cpp.
|
protectedpure virtual |
Does the actual reading from the stream into this FFData object.
std::exception | |
StringUtils::StringException | |
FFStreamError |
Implemented in gnsstk::IonexHeader, gnsstk::IonexData, gnsstk::BinexData, gnsstk::Rinex3ObsHeader, gnsstk::AntexData, gnsstk::RinexObsHeader, gnsstk::RinexNavData, gnsstk::RinexMetHeader, gnsstk::RinexClockHeader, gnsstk::Rinex3NavData, gnsstk::Rinex3ClockHeader, gnsstk::Rinex3NavHeader, gnsstk::SP3Header, gnsstk::Rinex3ObsData, gnsstk::SP3Data, gnsstk::AntexHeader, gnsstk::RinexNavHeader, gnsstk::YumaData, gnsstk::RinexObsData, gnsstk::SEMData, gnsstk::Rinex3ClockData, gnsstk::RinexMetData, gnsstk::SEMHeader, gnsstk::Sinex::Data, gnsstk::RinexClockData, gnsstk::YumaHeader, FileFilter_T::FFTData, gnsstk::AshtechMBEN, gnsstk::AshtechData, gnsstk::AshtechPBEN, gnsstk::AshtechEPB, and gnsstk::AshtechALB.
|
protectedpure virtual |
Does the actual writing from the stream into this FFData object.
std::exception | |
StringUtils::StringException | |
FFStreamError |
Implemented in gnsstk::IonexHeader, gnsstk::IonexData, gnsstk::BinexData, gnsstk::Rinex3ObsHeader, gnsstk::AntexData, gnsstk::RinexObsHeader, gnsstk::RinexNavData, gnsstk::RinexMetHeader, gnsstk::Rinex3NavData, gnsstk::RinexClockHeader, gnsstk::Rinex3ClockHeader, gnsstk::Rinex3NavHeader, gnsstk::SP3Header, gnsstk::Rinex3ObsData, gnsstk::SP3Data, gnsstk::AntexHeader, gnsstk::RinexNavHeader, gnsstk::YumaData, gnsstk::Rinex3ClockData, gnsstk::SEMData, gnsstk::RinexObsData, gnsstk::RinexMetData, gnsstk::SEMHeader, gnsstk::RinexClockData, gnsstk::Sinex::Data, FileFilter_T::FFTData, gnsstk::YumaHeader, and gnsstk::AshtechData.
|
friend |
Definition at line 165 of file FFData.hpp.
Our generic formatted output operator This function provides compatibility with the ostream_iterator class.
o | the stream to write to |
f | the data to write |
o
FFStreamError | |
StringUtils::StringException |
Definition at line 59 of file FFData.cpp.
Generic formatted input operator. This should throw the same exceptions as FFData::getRecord(). Please read that for more info.
f | formatted file data record. |
i | the stream to read from |
FFStreamError | if the file being read is formatted incorrectly or some other file error occurs |
StringUtils::StringException | when StringUtils messes up. |
i
. This function provides compatibility with the istream_iterator class. Definition at line 65 of file FFData.cpp.