Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
gnsstk::FileFilterFrame< FileStream, FileData > Class Template Reference

Detailed Description

template<class FileStream, class FileData>
class gnsstk::FileFilterFrame< FileStream, FileData >

This class is a wrapper for FileSpecFind and FileFilter, allowing you to easily pick what files you want to process and how to process them. In the constructors, providing a start and end time will allow FileSpecFind to pick the correct files for that date range. After the object is built, it is ready for filtering.

Use the filter(), sort(), unique() and touch() operators to run whatever operations you want to on the data, then write out the files when you're done. You can also get access to the data with getData() and run whatever other post processing tools you would like to.

See the examples in FileFilterFrameTest.cpp for a demonstration.

Definition at line 73 of file FileFilterFrame.hpp.

#include <FileFilterFrame.hpp>

Inheritance diagram for gnsstk::FileFilterFrame< FileStream, FileData >:
Inheritance graph
[legend]

Public Member Functions

 FileFilterFrame (const FileSpec &spec, const gnsstk::CommonTime &start=gnsstk::CommonTime::BEGINNING_OF_TIME, const gnsstk::CommonTime &end=gnsstk::CommonTime::END_OF_TIME, const FileSpecFind::Filter &filter=FileSpecFind::Filter())
 
 FileFilterFrame (const gnsstk::CommonTime &start=gnsstk::CommonTime::BEGINNING_OF_TIME, const gnsstk::CommonTime &end=gnsstk::CommonTime::END_OF_TIME)
 
 FileFilterFrame (const std::string &filename, const gnsstk::CommonTime &start=gnsstk::CommonTime::BEGINNING_OF_TIME, const gnsstk::CommonTime &end=gnsstk::CommonTime::END_OF_TIME)
 
 FileFilterFrame (const std::vector< std::string > &fileList, const gnsstk::CommonTime &start=gnsstk::CommonTime::BEGINNING_OF_TIME, const gnsstk::CommonTime &end=gnsstk::CommonTime::END_OF_TIME)
 
FileFilterFramenewSource (const FileSpec &filespec, const gnsstk::CommonTime &start=gnsstk::CommonTime::BEGINNING_OF_TIME, const gnsstk::CommonTime &end=gnsstk::CommonTime::END_OF_TIME, const FileSpecFind::Filter &filter=FileSpecFind::Filter())
 
FileFilterFramenewSource (const std::string &filename, const gnsstk::CommonTime &start=gnsstk::CommonTime::BEGINNING_OF_TIME, const gnsstk::CommonTime &end=gnsstk::CommonTime::END_OF_TIME)
 
FileFilterFramenewSource (const std::vector< std::string > &fileList, const gnsstk::CommonTime &start=gnsstk::CommonTime::BEGINNING_OF_TIME, const gnsstk::CommonTime &end=gnsstk::CommonTime::END_OF_TIME)
 
bool writeFile (const std::string &outputFile, const bool append=false) const
 
bool writeFile (FileStream &stream) const
 
virtual ~FileFilterFrame ()
 
- Public Member Functions inherited from gnsstk::FileFilter< FileData >
FileFilteraddData (const FileData &ffd)
 Adds the given data into the filter. More...
 
FileFilteraddData (const std::list< FileData > &datavec)
 Adds arbitrary data to the filter. More...
 
FileData & back ()
 
const FileData & back () const
 
std::list< FileData >::iterator begin ()
 
std::list< FileData >::const_iterator begin () const
 
void clear ()
 
template<class BinaryPredicate >
std::pair< std::list< FileData >, std::list< FileData > > diff (const FileFilter< FileData > &r, BinaryPredicate p) const
 
bool empty () const
 
std::list< FileData >::iterator end ()
 
std::list< FileData >::const_iterator end () const
 
 FileFilter (void)
 Default constructor. More...
 
template<class Predicate >
FileFilterfilter (Predicate up)
 
template<class Predicate >
std::list< FileData > findAll (Predicate p) const
 Returns a list of data matching the given unary predicate. More...
 
FileData & front ()
 
const FileData & front () const
 
std::list< FileData > & getData (void)
 Returns the contents of the data list. More...
 
std::list< FileData > getData (void) const
 Returns the contents of the data list, const. More...
 
std::list< FileData >::size_type getDataCount (void) const
 Returns the number of data items in the filter. More...
 
int getFiltered () const
 
FileFiltermerge (const FileFilter &right)
 Combines the data from the input filter to this object. More...
 
template<class Compare >
FileFiltermerge (const FileFilter &right, Compare bp)
 
std::list< FileData >::size_type size ()
 
template<class Compare >
FileFiltersort (Compare comp)
 
template<class Operation >
FileFiltertouch (const Operation &op)
 a const operator touch for the classes that need it. More...
 
template<class Operation >
FileFiltertouch (Operation &op)
 
template<class BinaryPredicate >
FileFilterunique (BinaryPredicate bp)
 
virtual ~FileFilter ()
 Destructor. More...
 

Protected Member Functions

void init (const FileSpecFind::Filter &filter=FileSpecFind::Filter())
 

Protected Attributes

gnsstk::CommonTime endTime
 
FileSpec fs
 The file spec for this filter. More...
 
gnsstk::CommonTime startTime
 the start and end dates for the filter. More...
 
- Protected Attributes inherited from gnsstk::FileFilter< FileData >
lType dataVec
 
int filtered
 A count of the last number of items filtered. More...
 

Additional Inherited Members

- Protected Types inherited from gnsstk::FileFilter< FileData >
typedef std::list< FileData >::iterator lItrType
 
typedef std::list< FileData > lType
 List of file data to be filtered. More...
 

Constructor & Destructor Documentation

◆ FileFilterFrame() [1/4]

template<class FileStream , class FileData >
gnsstk::FileFilterFrame< FileStream, FileData >::FileFilterFrame ( const gnsstk::CommonTime start = gnsstk::CommonTime::BEGINNING_OF_TIME,
const gnsstk::CommonTime end = gnsstk::CommonTime::END_OF_TIME 
)

Default constructor.

Exceptions
Exception

Definition at line 187 of file FileFilterFrame.hpp.

◆ FileFilterFrame() [2/4]

template<class FileStream , class FileData >
gnsstk::FileFilterFrame< FileStream, FileData >::FileFilterFrame ( const std::vector< std::string > &  fileList,
const gnsstk::CommonTime start = gnsstk::CommonTime::BEGINNING_OF_TIME,
const gnsstk::CommonTime end = gnsstk::CommonTime::END_OF_TIME 
)

Takes a list of files to open in lieu of day times.

Exceptions
Exception

Definition at line 194 of file FileFilterFrame.hpp.

◆ FileFilterFrame() [3/4]

template<class FileStream , class FileData >
gnsstk::FileFilterFrame< FileStream, FileData >::FileFilterFrame ( const std::string &  filename,
const gnsstk::CommonTime start = gnsstk::CommonTime::BEGINNING_OF_TIME,
const gnsstk::CommonTime end = gnsstk::CommonTime::END_OF_TIME 
)

Takes a file name for a single file filter.

Exceptions
Exceptionwhen there's a file error.

Definition at line 209 of file FileFilterFrame.hpp.

◆ FileFilterFrame() [4/4]

Uses the FileSpec to retrieve files. Use filter like you would in FileSpecFind, to filter FOR stations, receivers, etc.

Exceptions
Exceptionwhen there's a file error.

Definition at line 219 of file FileFilterFrame.hpp.

◆ ~FileFilterFrame()

template<class FileStream , class FileData >
virtual gnsstk::FileFilterFrame< FileStream, FileData >::~FileFilterFrame ( )
inlinevirtual

Definition at line 141 of file FileFilterFrame.hpp.

Member Function Documentation

◆ init()

template<class FileStream , class FileData >
void gnsstk::FileFilterFrame< FileStream, FileData >::init ( const FileSpecFind::Filter filter = FileSpecFind::Filter())
protected

Run init() to load the data into the filter.

Exceptions
Exception

Definition at line 281 of file FileFilterFrame.hpp.

◆ newSource() [1/3]

template<class FileStream , class FileData >
FileFilterFrame< FileStream, FileData > & gnsstk::FileFilterFrame< FileStream, FileData >::newSource ( const FileSpec filespec,
const gnsstk::CommonTime start = gnsstk::CommonTime::BEGINNING_OF_TIME,
const gnsstk::CommonTime end = gnsstk::CommonTime::END_OF_TIME,
const FileSpecFind::Filter filter = FileSpecFind::Filter() 
)

Gets the files from the file spec and the time, then adds the data to the filter. Use filter like you would in FileSpecFind, to filter FOR stations, receivers, etc.

Exceptions
Exception

Definition at line 231 of file FileFilterFrame.hpp.

◆ newSource() [2/3]

template<class FileStream , class FileData >
FileFilterFrame< FileStream, FileData > & gnsstk::FileFilterFrame< FileStream, FileData >::newSource ( const std::string &  filename,
const gnsstk::CommonTime start = gnsstk::CommonTime::BEGINNING_OF_TIME,
const gnsstk::CommonTime end = gnsstk::CommonTime::END_OF_TIME 
)

Reads in the file and adds the data to the filter.

Exceptions
Exception

Definition at line 247 of file FileFilterFrame.hpp.

◆ newSource() [3/3]

template<class FileStream , class FileData >
FileFilterFrame< FileStream, FileData > & gnsstk::FileFilterFrame< FileStream, FileData >::newSource ( const std::vector< std::string > &  fileList,
const gnsstk::CommonTime start = gnsstk::CommonTime::BEGINNING_OF_TIME,
const gnsstk::CommonTime end = gnsstk::CommonTime::END_OF_TIME 
)

Takes a list of files to open in lieu of day times

Exceptions
Exception

Definition at line 262 of file FileFilterFrame.hpp.

◆ writeFile() [1/2]

template<class FileStream , class FileData >
bool gnsstk::FileFilterFrame< FileStream, FileData >::writeFile ( const std::string &  outputFile,
const bool  append = false 
) const

Writes the data to the file outputFile, truncating the output file if it already exists unless append is true. This can throw an exception when there's a file error.

Returns
true when it works.
Warning
This will not write out headers for files that need them, and files that depend on header data will (like RINEX) will not be written correctly with this function. Use FileFilterFrameWithHeader for those file types.
Exceptions
Exception

Definition at line 303 of file FileFilterFrame.hpp.

◆ writeFile() [2/2]

template<class FileStream , class FileData >
bool gnsstk::FileFilterFrame< FileStream, FileData >::writeFile ( FileStream &  stream) const

Writes the data to the supplied stream. This can throw an exception when there's a file error.

Returns
true when it works.
Warning
This will not write out headers for files that need them, and files that depend on header data will (like RINEX) will not be written correctly with this function. Use FileFilterFrameWithHeader for those file types.
Exceptions
Exception

Definition at line 326 of file FileFilterFrame.hpp.

Member Data Documentation

◆ endTime

template<class FileStream , class FileData >
gnsstk::CommonTime gnsstk::FileFilterFrame< FileStream, FileData >::endTime
protected

Definition at line 179 of file FileFilterFrame.hpp.

◆ fs

template<class FileStream , class FileData >
FileSpec gnsstk::FileFilterFrame< FileStream, FileData >::fs
protected

The file spec for this filter.

Definition at line 177 of file FileFilterFrame.hpp.

◆ startTime

template<class FileStream , class FileData >
gnsstk::CommonTime gnsstk::FileFilterFrame< FileStream, FileData >::startTime
protected

the start and end dates for the filter.

Definition at line 179 of file FileFilterFrame.hpp.


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


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