This class is a framework for sorting and filtering file data. It borrows several datatypes from FileSpec for cohesion of data types. Add the data to the filter, specify the parameters (date, exclusion filters, etc.), then process it. For the specific data type, you can specify your own operators for sorting, uniqueness, or almost anything else you want to do to the data.
Definition at line 76 of file FileFilter.hpp.
#include <FileFilter.hpp>
Classes | |
class | SortAdapter |
Public Member Functions | |
FileFilter & | addData (const FileData &ffd) |
Adds the given data into the filter. More... | |
FileFilter & | addData (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 > | |
FileFilter & | filter (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 |
FileFilter & | merge (const FileFilter &right) |
Combines the data from the input filter to this object. More... | |
template<class Compare > | |
FileFilter & | merge (const FileFilter &right, Compare bp) |
std::list< FileData >::size_type | size () |
template<class Compare > | |
FileFilter & | sort (Compare comp) |
template<class Operation > | |
FileFilter & | touch (const Operation &op) |
a const operator touch for the classes that need it. More... | |
template<class Operation > | |
FileFilter & | touch (Operation &op) |
template<class BinaryPredicate > | |
FileFilter & | unique (BinaryPredicate bp) |
virtual | ~FileFilter () |
Destructor. More... | |
Protected Types | |
typedef std::list< FileData >::iterator | lItrType |
typedef std::list< FileData > | lType |
List of file data to be filtered. More... | |
Protected Attributes | |
lType | dataVec |
int | filtered |
A count of the last number of items filtered. More... | |
|
protected |
Definition at line 359 of file FileFilter.hpp.
|
protected |
List of file data to be filtered.
Definition at line 357 of file FileFilter.hpp.
gnsstk::FileFilter< FileData >::FileFilter | ( | void | ) |
Default constructor.
Definition at line 390 of file FileFilter.hpp.
|
virtual |
Destructor.
Definition at line 395 of file FileFilter.hpp.
FileFilter< FileData > & gnsstk::FileFilter< FileData >::addData | ( | const FileData & | ffd | ) |
Adds the given data into the filter.
Definition at line 401 of file FileFilter.hpp.
FileFilter< FileData > & gnsstk::FileFilter< FileData >::addData | ( | const std::list< FileData > & | datavec | ) |
Adds arbitrary data to the filter.
Definition at line 409 of file FileFilter.hpp.
|
inline |
Definition at line 343 of file FileFilter.hpp.
|
inline |
Definition at line 349 of file FileFilter.hpp.
|
inline |
Definition at line 316 of file FileFilter.hpp.
|
inline |
Definition at line 310 of file FileFilter.hpp.
|
inline |
Definition at line 325 of file FileFilter.hpp.
|
inline |
Returns two lists - one of the data in *this that isn't in r and the second of data in r that isn't in *this. Remember that /a p has to be a strict weak ordering on the data.
Definition at line 257 of file FileFilter.hpp.
|
inline |
Definition at line 322 of file FileFilter.hpp.
|
inline |
Definition at line 319 of file FileFilter.hpp.
|
inline |
Definition at line 313 of file FileFilter.hpp.
|
inline |
This filters data based on a single test. All data that passes the UnaryPredicate (i.e. it returns true) is removed Filtered count is incremented for each value removed.
Definition at line 199 of file FileFilter.hpp.
|
inline |
Returns a list of data matching the given unary predicate.
Definition at line 278 of file FileFilter.hpp.
|
inline |
Definition at line 331 of file FileFilter.hpp.
|
inline |
Definition at line 337 of file FileFilter.hpp.
|
inline |
Returns the contents of the data list.
Definition at line 299 of file FileFilter.hpp.
|
inline |
Returns the contents of the data list, const.
Definition at line 303 of file FileFilter.hpp.
|
inline |
Returns the number of data items in the filter.
Definition at line 307 of file FileFilter.hpp.
|
inline |
Returns the number of items filtered from the last filter() touch() or unique() call.
Definition at line 295 of file FileFilter.hpp.
FileFilter< FileData > & gnsstk::FileFilter< FileData >::merge | ( | const FileFilter< FileData > & | right | ) |
Combines the data from the input filter to this object.
Definition at line 419 of file FileFilter.hpp.
|
inline |
Combines the data from the input filter to this object using the predicate to sort the data it merges. This should use list::merge(list, bp) but since it's broken in forte...
Definition at line 152 of file FileFilter.hpp.
|
inline |
Definition at line 328 of file FileFilter.hpp.
|
inline |
Sorts the data.
Definition at line 94 of file FileFilter.hpp.
|
inline |
a const operator touch for the classes that need it.
Definition at line 243 of file FileFilter.hpp.
|
inline |
Applies Operation on all the data elements, counting each one that gets modified (for which Operation returns true). The operation is passed by reference so that it can retain state information for use by the program calling it.
Definition at line 225 of file FileFilter.hpp.
|
inline |
After sorting, use this to ensure that each data value is unique. Filtered count is incremented for each duplicate value removed.
bp | Test for equality |
Definition at line 160 of file FileFilter.hpp.
|
protected |
Definition at line 358 of file FileFilter.hpp.
|
protected |
A count of the last number of items filtered.
Definition at line 384 of file FileFilter.hpp.