30 virtual const char* selectorType()
const = 0;
31 virtual bool isOK()
const {
return true; }
39 virtual bool includes(
const T&)
const = 0;
42 const T& stop)
const {
return -1; }
47 virtual bool include(
const T&,
const char* =0) {
return false; }
74 virtual char includesRange(
const T& start,
76 virtual bool include(
const T& t,
const char* )
77 { val_ = t;
return true; }
106 {
return range_.includes( t,
true ); }
107 virtual bool include(
const T& t,
const char* )
108 { range_.include( t );
return true; }
130 : vals_(0), sz_(0), valsmine_(true) {}
132 : vals_(v), sz_(s), valsmine_(false) {}
134 : vals_(x.vals_), sz_(x.sz_), valsmine_(false) {}
136 {
if ( valsmine_ )
delete []
const_cast<T*
>(vals_); }
144 for (
int idx=0; idx<sz_; idx++ )
145 {
if ( vals_[idx] == t )
return true; }
159 if ( sz_ != ass.
sz_ )
return false;
160 for (
int idx=0; idx<sz_; idx++ )
161 {
if ( !ss.
includes(vals_[idx]) )
return false;}
170 template <
class T>
inline 174 if ( start==stop==val_ )
void manageVals(bool yn=true)
Definition: selector.h:148
virtual bool canDoRange() const
Definition: selector.h:40
virtual bool isOK() const
Definition: selector.h:31
virtual const char * selectorType() const
Definition: selector.h:67
SingleSelector(const T &t)
Definition: selector.h:66
virtual ~Selector()
Definition: selector.h:29
bool isEqual(const Selector< T > &s) const
Definition: selector.h:32
Interval< T > range_
Definition: selector.h:110
virtual bool include(const T &t, const char *)
Definition: selector.h:107
const T * vals_
Definition: selector.h:150
virtual Selector< T > * clone() const
Definition: selector.h:68
ArraySelector()
Definition: selector.h:129
RangeSelector(const T &t1, const T &t2)
Definition: selector.h:99
Selector based on range specification (an Interval).
Definition: selector.h:94
virtual const char * selectorType() const =0
Interval of values.
Definition: commontypes.h:31
virtual bool isEq(const Selector< T > &ss) const
Definition: selector.h:83
int sz_
Definition: selector.h:151
Selector selecting only a single value.
Definition: selector.h:61
virtual bool isEq(const Selector< T > &rs) const
Definition: selector.h:114
virtual bool include(const T &, const char *=0)
Definition: selector.h:47
virtual bool isEq(const Selector< T > &ss) const
Definition: selector.h:155
virtual bool includes(const T &t) const
Definition: selector.h:105
virtual Selector< T > * clone() const
Definition: selector.h:139
Interface for classes that select on basis of a key.
Definition: selector.h:25
virtual const char * selectorType() const
Definition: selector.h:138
virtual bool includes(const T &t) const
Definition: selector.h:142
T val_
Definition: selector.h:79
virtual Selector< T > * clone() const
Definition: selector.h:102
virtual char includesRange(const T &start, const T &stop) const
Definition: selector.h:41
virtual bool includes(const T &t) const
Definition: selector.h:71
virtual const char * selectorType() const
Definition: selector.h:101
ArraySelector(const T *v, int s)
Definition: selector.h:131
bool includes(const X &, bool allowrev) const
Definition: ranges.h:482
virtual bool include(const T &t, const char *)
Definition: selector.h:76
~ArraySelector()
Definition: selector.h:135
virtual char includesRange(const T &start, const T &stop) const
Definition: selector.h:171
virtual bool canDoRange() const
Definition: selector.h:73
RangeSelector()
Definition: selector.h:98
#define mClass(module)
Definition: commondefs.h:164
ArraySelector(const ArraySelector &x)
Definition: selector.h:133
SingleSelector()
Definition: selector.h:65
Selector based on array.
Definition: selector.h:125
bool valsmine_
Definition: selector.h:165
virtual bool includes(const T &) const =0