15 #pragma warning(disable : 4800)
43 template <
class MatchFuncArgType,
class DataFuncArgType = MatchFuncArgType,
44 bool needsConversion =
false>
47 typedef std::shared_ptr<
110 virtual bool Match(
const DataFuncArgType arg)
const {
116 tRes =
static_cast<bool>(mfArg);
169 MatchFuncArgType mfArg;
171 std::is_same<MatchFuncArgType, DataFuncArgType>::value) {
183 MatchFuncArgType mfArg;
194 template <
class T1,
class T2>
195 int queryCmp(
const T1 v1,
const T2 v2,
const T1 tol) {
#define PRECONDITION(expr, mess)
class to allow integer values to pick templates
Base class for all queries.
MatchFuncArgType(* d_dataFunc)(DataFuncArgType)
MatchFuncArgType TypeConvert(DataFuncArgType what, Int2Type< true >) const
calls our dataFunc (which must be set) on what and returns the
bool(*)(MatchFuncArgType) getMatchFunc() const
returns our match function:
MatchFuncArgType(* d_dataFuncSameType)(MatchFuncArgType)
virtual std::string getFullDescription() const
returns a fuller text description
virtual bool Match(const DataFuncArgType arg) const
returns whether or not we match the argument
MatchFuncArgType TypeConvert(MatchFuncArgType what, Int2Type< false >) const
calls our dataFunc (if it's set) on what and returns the result, otherwise returns what
void addChild(CHILD_TYPE child)
adds a child to our list of children
void setDescription(const char *descr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
const std::string & getTypeLabel() const
returns our text label.
std::shared_ptr< Query< MatchFuncArgType, DataFuncArgType, needsConversion > > CHILD_TYPE
CHILD_VECT_CI endChildren() const
returns an iterator for the end of our child vector
const std::string & getDescription() const
returns our text description
CHILD_VECT_CI beginChildren() const
returns an iterator for the beginning of our child vector
void setDataFunc(MatchFuncArgType(*what)(DataFuncArgType))
sets our data function
void setTypeLabel(const std::string &typ)
sets our type label
virtual Query< MatchFuncArgType, DataFuncArgType, needsConversion > * copy() const
returns a copy of this Query
bool getNegation() const
returns whether or not we are negated
void setNegation(bool what)
sets whether or not we are negated
CHILD_VECT::const_iterator CHILD_VECT_CI
void setMatchFunc(bool(*what)(MatchFuncArgType))
sets our match function
CHILD_VECT::iterator CHILD_VECT_I
void setTypeLabel(const char *typ)
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::vector< CHILD_TYPE > CHILD_VECT
MatchFuncArgType(*)(DataFuncArgType) getDataFunc() const
returns our data function:
void setDescription(const std::string &descr)
sets our text description
std::string d_description
bool(* d_matchFunc)(MatchFuncArgType)
int queryCmp(const T1 v1, const T2 v2, const T1 tol)