FFData Class Reference
[Formatted file I/O]

#include <FFData.hpp>

Inheritance diagram for FFData:

Inheritance graph
[legend]
List of all members.

Detailed Description

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).

See also:
FFStream for more information.

Definition at line 94 of file FFData.hpp.

Public Member Functions

virtual ~FFData (void)
 virtual desctuctor
void putRecord (FFStream &s) const throw (FFStreamError, gpstk::StringUtils::StringException)
 Send a "record" to the given stream.
void getRecord (FFStream &s) throw (FFStreamError, gpstk::StringUtils::StringException)
 Retrieve a "record" from the given stream.
virtual void dump (std::ostream &s) const
 Send debug output to the given stream.
virtual bool isHeader () const
 Returns whether or not this class is a header.
virtual bool isData () const
 Returns whether or not this class is data.

Protected Member Functions

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

Friends

class FFStream
std::ostream & operator<< (std::ostream &o, const FFData &f) throw (FFStreamError, gpstk::StringUtils::StringException)
 Our generic formatted output operator This function provides compatibility with the ostream_iterator class.
std::istream & operator>> (std::istream &i, FFData &f) throw (FFStreamError, gpstk::StringUtils::StringException)
 Generic formatted input operator.


Constructor & Destructor Documentation

virtual ~FFData void   )  [inline, virtual]
 

virtual desctuctor

Definition at line 98 of file FFData.hpp.


Member Function Documentation

virtual void dump std::ostream &  s  )  const [inline, virtual]
 

Send debug output to the given stream.

Parameters:
s a generic output stream

Reimplemented in AntexHeader, AshtechALB, AshtechData, AshtechEPB, AshtechMBEN, AshtechPBEN, MDPHeader, MDPNavSubframe, MDPObsEpoch, MDPPVTSolution, MDPSelftestStatus, NovatelData, TestFFData, BinexData, FICData, FICHeader, IonexData, IonexHeader, MSCHeader, Rinex3ClockData, Rinex3ClockHeader, Rinex3NavData, Rinex3NavHeader, Rinex3ObsData, Rinex3ObsHeader, RinexClockData, RinexMetData, RinexMetHeader, RinexNavData, RinexNavHeader, RinexObsData, RinexObsHeader, SEMData, SEMHeader, SMODFData, SP3Header, YumaData, and YumaHeader.

Definition at line 127 of file FFData.hpp.

void getRecord FFStream s  )  throw (FFStreamError, gpstk::StringUtils::StringException)
 

Retrieve a "record" from the given stream.

By default, this won't throw exceptions. You can change this by enabling exceptions with this code:

 filestream.exceptions(fstream::failbit);
Parameters:
s a FFStream-based stream
Exceptions:
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 62 of file FFData.cpp.

virtual bool isData void   )  const [inline, virtual]
 

Returns whether or not this class is data.

Have your overriding function return the correct value.

Reimplemented in AntexData, AshtechData, ATSData, MDPHeader, NovatelData, BinexData, FICData, IonexData, MSCData, Rinex3ClockData, Rinex3NavData, RinexClockData, RinexMetData, RinexNavData, RinexObsData, SEMData, SMODFData, SP3Data, and YumaData.

Definition at line 138 of file FFData.hpp.

virtual bool isHeader void   )  const [inline, virtual]
 

Returns whether or not this class is a header.

Have your overriding function return the correct value.

Reimplemented in AntexHeader, NovatelData, FICHeader, IonexHeader, MSCHeader, Rinex3ClockHeader, Rinex3NavHeader, Rinex3ObsHeader, RinexClockHeader, RinexMetHeader, RinexNavHeader, RinexObsHeader, SEMHeader, SP3Header, and YumaHeader.

Definition at line 133 of file FFData.hpp.

void putRecord FFStream s  )  const throw (FFStreamError, gpstk::StringUtils::StringException)
 

Send a "record" to the given stream.

Parameters:
s a FFStream-based stream

Definition at line 56 of file FFData.cpp.

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

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

Implemented in AntexData, AntexHeader, AshtechALB, AshtechData, AshtechEPB, AshtechMBEN, AshtechPBEN, ATSData, MDPHeader, NovatelData, TestFFData, BinexData, FICData, FICHeader, IonexData, IonexHeader, MSCHeader, Rinex3ClockData, Rinex3ClockHeader, Rinex3NavData, Rinex3NavHeader, Rinex3ObsData, Rinex3ObsHeader, RinexClockData, RinexClockHeader, RinexMetData, RinexMetHeader, RinexNavData, RinexNavHeader, RinexObsData, RinexObsHeader, SEMData, SEMHeader, SP3Data, SP3Header, YumaData, and YumaHeader.

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

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

Implemented in AntexData, AntexHeader, AshtechData, ATSData, MDPHeader, NovatelData, TestFFData, BinexData, FICData, FICHeader, IonexData, IonexHeader, MSCHeader, Rinex3ClockData, Rinex3ClockHeader, Rinex3NavData, Rinex3NavHeader, Rinex3ObsData, Rinex3ObsHeader, RinexClockData, RinexClockHeader, RinexMetData, RinexMetHeader, RinexNavData, RinexNavHeader, RinexObsData, RinexObsHeader, SEMData, SEMHeader, SP3Data, SP3Header, YumaData, and YumaHeader.


Friends And Related Function Documentation

friend class FFStream [friend]
 

Definition at line 173 of file FFData.hpp.

std::ostream& operator<< std::ostream &  o,
const FFData f
throw (FFStreamError, gpstk::StringUtils::StringException) [friend]
 

Our generic formatted output operator This function provides compatibility with the ostream_iterator class.

Parameters:
o the stream to write to
f the data to write
Returns:
a reference to o
Warning:
The ostream provided MUST be an FFStream.

Definition at line 68 of file FFData.cpp.

std::istream& operator>> std::istream &  i,
FFData f
throw (FFStreamError, gpstk::StringUtils::StringException) [friend]
 

Generic formatted input operator.

This should throw the same exceptions as FFData::getRecord(). Please read that for more info.

See also:
FFData::getRecord().
Warning:
see FFData::getRecord() for more info on exceptions
Parameters:
f formatted file data record.
i the stream to read from
Exceptions:
FFStreamError if the file being read is formatted incorrectly or some other file error occurs
StringException when StringUtils messes up.
Warning:
read the notes for getRecord() for whatever class you'll be using this with.
Returns:
a reference to i. This function provides compatibility with the istream_iterator class.
Warning:
The istream provided MUST be an FFStream.

Definition at line 85 of file FFData.cpp.


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