Library: Data
Package: DataCore
Header: Poco/Data/RowFilter.h
RowFilter class provides row filtering functionality. A filter contains a set of criteria (field name, value and logical operation) for row filtering. Additionally, a row filter contains a map of pointers to other filters with related logical operations between filters. RowFilter is typically added to recordset in order to filter its content. Since the recordset own iteration is dependent upon filtering, whenever the filtering criteria is changed, the filter automatically notifies all associated recordsets by rewinding them to the first position.
Direct Base Classes: Poco::RefCountedObject
All Base Classes: Poco::RefCountedObject
Member Functions: add, addAnd, addFilter, addOr, exists, isAllowed, isEmpty, isNot, remove, removeFilter, toggleNot
Inherited Functions: duplicate, referenceCount, release
typedef bool (* CompT)(const Poco::Dynamic::Var &, const Poco::Dynamic::Var &);
typedef Tuple < Poco::Dynamic::Var, Comparison, LogicOperator > ComparisonEntry;
typedef std::multimap < std::string, ComparisonEntry > ComparisonMap;
typedef std::map < std::string, Comparison > Comparisons;
typedef std::map < AutoPtr < RowFilter >, LogicOperator > FilterMap;
typedef AutoPtr < RowFilter > Ptr;
RowFilter(
RecordSet * pRecordSet
);
Creates the top-level RowFilter and associates it with the recordset.
RowFilter(
Ptr pParent,
LogicOperator op = OP_OR
);
Creates child RowFilter and associates it with the parent filter.
~RowFilter();
Destroys the RowFilter.
template < typename T > void add(
const std::string & name,
Comparison comparison,
const T & value,
LogicOperator op = OP_OR
);
Adds value to the filter.
template < typename T > void add(
const std::string & name,
const std::string & comp,
const T & value,
LogicOperator op = OP_OR
);
Adds value to the filter.
template < typename T > void addAnd(
const std::string & name,
const std::string & comp,
const T & value
);
Adds logically AND-ed value to the filter.
void addFilter(
const Ptr & pFilter,
LogicOperator comparison
);
Appends another filter to this one.
template < typename T > void addOr(
const std::string & name,
const std::string & comp,
const T & value
);
Adds logically OR-ed value to the filter.
bool exists(
const std::string & name
) const;
Returns true if name is known to this row filter.
bool isAllowed(
std::size_t row
) const;
Returns true if name and value are allowed.
bool isEmpty() const;
Returns true if there is not filtering criteria specified.
bool isNot() const;
Returns true if filter is NOT-ed, false otherwise.
int remove(
const std::string & name
);
Removes named comparisons from the filter. All comparisons with specified name are removed. Returns the number of comparisons removed.
void removeFilter(
const Ptr & pFilter
);
Removes filter from this filter.
void toggleNot();
Togless the NOT operator for this filter;