Public Member Functions | Protected Member Functions | Friends | List of all members
gnsstk::FFData Class Referenceabstract

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 87 of file FFData.hpp.

#include <FFData.hpp>

Inheritance diagram for gnsstk::FFData:
Inheritance graph
[legend]

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)
 

Constructor & Destructor Documentation

◆ ~FFData()

virtual gnsstk::FFData::~FFData ( void  )
inlinevirtual

virtual desctuctor

Definition at line 91 of file FFData.hpp.

Member Function Documentation

◆ dump()

virtual void gnsstk::FFData::dump ( std::ostream &  s) const
inlinevirtual

◆ getRecord()

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:

filestream.exceptions(fstream::failbit);
Parameters
sa FFStream-based stream
Exceptions
StringUtils::StringExceptionwhen a StringUtils function fails
FFStreamErrorwhen 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.

◆ isData()

virtual bool gnsstk::FFData::isData ( ) const
inlinevirtual

◆ isHeader()

virtual bool gnsstk::FFData::isHeader ( ) const
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.

◆ putRecord()

void gnsstk::FFData::putRecord ( FFStream s) const

Send a "record" to the given stream.

Parameters
sa FFStream-based stream
Exceptions
FFStreamError
StringUtils::StringException

Definition at line 49 of file FFData.cpp.

◆ reallyGetRecord()

virtual void gnsstk::FFData::reallyGetRecord ( FFStream s)
protectedpure virtual

◆ reallyPutRecord()

virtual void gnsstk::FFData::reallyPutRecord ( FFStream s) const
protectedpure virtual

Friends And Related Function Documentation

◆ FFStream

friend class FFStream
friend

Definition at line 165 of file FFData.hpp.

◆ operator<<

std::ostream& operator<< ( FFStream o,
const FFData f 
)
friend

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

Parameters
othe stream to write to
fthe data to write
Returns
a reference to o
Exceptions
FFStreamError
StringUtils::StringException

Definition at line 59 of file FFData.cpp.

◆ operator>>

std::istream& operator>> ( FFStream i,
FFData f 
)
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
fformatted file data record.
ithe stream to read from
Exceptions
FFStreamErrorif the file being read is formatted incorrectly or some other file error occurs
StringUtils::StringExceptionwhen 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.

Definition at line 65 of file FFData.cpp.


The documentation for this class was generated from the following files:


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:44