39 inline bool check(
double* point);
55 static std::map<std::string, Checker* (*)(const std::string&)>*
factory;
64 virtual bool test(
double* point) = 0;
76 static Checker*
create(
const std::string& value) {
try {
return new T(value); }
catch(...) {
return 0; } }
82 virtual bool test(
double* point);
90 virtual bool test(
double* point);
98 virtual bool test(
double* point);
106 virtual bool test(
double* point);
111 #include "pointfilter.icc" 113 #endif //POINT_FILTER_H CheckerFactory(const std::string &key)
Instanciate in the source code with the to be created class as template argument and associated key s...
bool m_changed
If either not created yet or parameters get changed, this flag will cause check to create a new Check...
static Checker * create(const std::string &value)
Automated create function, safely returning a nullpointer if the constructor throws for unwanted valu...
Factory integrating the create-function and adding it to the lookup map in an easy template...
std::string getParams()
Serialization function to convert it into a string, usable in the constructor.
bool check(double *point)
Check a point, returning success if all contained Checker functions accept that point (implemented in...
std::map< std::string, std::string > m_params
Storage for parameter keys and values.
Checker * m_checker
created in the first check call with the changed flag set
static std::map< std::string, Checker *(*)(const std::string &)> * factory
Checker * m_next
Next test in chain.
PointFilter & setRange(double maxDist, double minDist)
PointFilter & setHeight(double top, double bottom)
void createCheckers()
Allocation of the checkers.