10 #ifndef __RD_SETQUERY_H__ 11 #define __RD_SETQUERY_H__ 22 template <
class MatchFuncArgType,
class DataFuncArgType=MatchFuncArgType,
23 bool needsConversion=
false>
25 public Query<MatchFuncArgType, DataFuncArgType,needsConversion> {
30 SetQuery() :
Query<MatchFuncArgType,DataFuncArgType,needsConversion>() {};
33 void insert(
const MatchFuncArgType what){
42 bool Match(
const DataFuncArgType what)
const {
52 typename std::set<MatchFuncArgType>::const_iterator i;
53 for(i=this->
d_set.begin();
63 typename CONTAINER_TYPE::const_iterator
beginSet()
const {
66 typename CONTAINER_TYPE::const_iterator
endSet()
const {
69 unsigned int size()
const {
74 std::ostringstream res;
78 std::copy(
d_set.begin(),
d_set.end(),std::ostream_iterator<MatchFuncArgType>(res,
", "));
bool getNegation() const
returns whether or not we are negated
void clear()
clears our set
std::string getFullDescription() const
returns a fuller text description
const std::string & getDescription() const
returns our text description
void setNegation(bool what)
sets whether or not we are negated
MatchFuncArgType TypeConvert(MatchFuncArgType what, Int2Type< false >) const
calls our dataFunc (if it's set) on what and returns the result, otherwise returns what ...
bool Match(const DataFuncArgType what) const
returns whether or not we match the argument
CONTAINER_TYPE::const_iterator beginSet() const
Query< MatchFuncArgType, DataFuncArgType, needsConversion > * copy() const
returns a copy of this Query
class to allow integer values to pick templates
MatchFuncArgType(* d_dataFunc)(DataFuncArgType)
void insert(const MatchFuncArgType what)
insert an entry into our set
void setDataFunc(MatchFuncArgType(*what)(DataFuncArgType))
sets our data function
CONTAINER_TYPE::const_iterator endSet() const
std::set< MatchFuncArgType > CONTAINER_TYPE
std::string d_description
unsigned int size() const
Base class for all queries.
a Query implementing a set: arguments must one of a set of values