44 class ObsFilter :
public DerivedValue<bool>{
46 Function<bool()>& filter_function;
49 value = filter_function();
52 void verify_integrity(){ };
55 ObsFilter(
const std::string& name, std::function<
bool()> filter_function,
const std::string& impl=
"")
56 :DerivedValue<bool>(name),
57 filter_function(GenFunction::register_function<bool()>(
"filter::"+name, filter_function, impl)){ }
62 ObsFilter* operator*(ObsFilter *f){
63 auto new_name = this->get_name() +
"&&" + f->get_name();
64 return new ObsFilter(new_name, [
this, f](){
return this->
get_value() && f->get_value();});
70 ObsFilter* operator+(ObsFilter *f){
71 auto new_name = this->get_name() +
"||" + f->get_name();
72 return new ObsFilter(new_name, [
this, f](){
return this->
get_value() || f->get_value();});
77 ObsFilter* operator!(){
78 auto new_name = std::string(
"!(") + this->get_name() + std::string(
")");
79 return new ObsFilter(new_name, [
this](){
return !this->
get_value();});
84 class RangeObsFilter :
public ObsFilter{
87 RangeObsFilter(
const std::string name, Value<T>* test_value, T range_low, T range_high):
88 ObsFilter(name, [test_value, range_low, range_high]{
89 T val = test_value->get_value();
90 return (val >= range_low) && (val < range_high);
bool & get_value()
Definition: value.hpp:516
The namespace containing all filval classes and functions.
Definition: api.hpp:38