1 #ifndef DUNE_FEM_VALIDATOR_HH 2 #define DUNE_FEM_VALIDATOR_HH 4 #warning "File 'fem/misc/validator.hh' is deprecated and will be deleted. Use lambdas instead, have a look into the fem/io/test/paramtertest.cc" 16 template<
class T,
class Impl >
24 template<
class T,
class Impl >
35 ThisType &operator= (
const ThisType & );
40 return asImp()( value );
43 void print(std::ostream& s)
const 51 return static_cast< const Impl &
>( *this );
56 return static_cast< Impl &
>( *this );
65 template<
class T,
class Impl >
76 ThisType &operator= (
const ThisType & );
80 void print ( std::ostream &s )
const;
94 : threshold_( threshold )
98 : threshold_( other.threshold_ )
104 return value > threshold_;
109 s <<
"ValidateLess: valid values are: > " << threshold_ << std::endl << std::endl;
127 : threshold_( threshold )
131 : threshold_( other.threshold_ )
136 return value < threshold_;
141 s <<
"ValidateLess: valid values are: < " << threshold_ << std::endl << std::endl;
159 : threshold_( threshold )
163 : threshold_( other.threshold_ )
168 return value <= threshold_;
173 s <<
"ValidateNotGreater: valid values are: <= " << threshold_ << std::endl << std::endl;
191 : threshold_( threshold )
195 : threshold_( other.threshold_ )
200 return value >= threshold_;
205 s <<
"ValidateNotLess: valid values are: >= " << threshold_ << std::endl << std::endl;
214 template<
class T,
bool leftClosed,
bool rightClosed >
216 :
public ValidatorDefault< T, ValidateInterval< T, leftClosed, rightClosed > >
223 : lThreshold_( lThreshold ),
224 rThreshold_( rThreshold )
228 : lThreshold_( other.lThreshold_ ),
229 rThreshold_( other.rThreshold_ )
235 ret &= (leftClosed ? value >= lThreshold_ : value > lThreshold_);
236 ret &= (rightClosed ? value <= rThreshold_ : value < rThreshold_);
242 const char* left = (leftClosed) ?
"[" :
"(";
243 const char* right = (rightClosed) ?
"]" :
")";
244 s <<
"ValidateInterval: valid values are " << left << lThreshold_ <<
"," <<
245 rThreshold_ << right << std::endl << std::endl;
272 return (value.find_first_of(
" \t" ) == std::string::npos);
275 void print ( std::ostream &s )
const 277 s <<
"NoWhiteSpaceValidator" << std::endl;
285 #endif // #ifndef DUNE_FEM_VALIDATOR_HH ValidateNotLess(const ThisType &other)
Definition: validator.hh:194
const T threshold_
Definition: validator.hh:177
NoWhiteSpaceValidator()
Definition: validator.hh:264
void print(std::ostream &s) const
Definition: validator.hh:203
Impl & asImp()
Definition: validator.hh:54
Definition: validator.hh:119
const Impl & asImp() const
Definition: validator.hh:49
ValidateNotGreater(const ThisType &other)
Definition: validator.hh:162
ValidateLess(const T &threshold)
Definition: validator.hh:126
const T threshold_
Definition: validator.hh:145
ValidateInterval(const T &lThreshold, const T &rThreshold)
Definition: validator.hh:222
ValidateNotLess(const T &threshold)
Definition: validator.hh:190
bool operator()(const T &value) const
Definition: validator.hh:38
const T rThreshold_
Definition: validator.hh:249
NoWhiteSpaceValidator(const ThisType &other)
Definition: validator.hh:267
ValidateNotGreater(const T &threshold)
Definition: validator.hh:158
void print(std::ostream &s) const
Definition: validator.hh:275
Definition: coordinate.hh:4
ValidateLess(const ThisType &other)
Definition: validator.hh:130
Definition: validator.hh:215
Definition: validator.hh:25
Definition: validator.hh:183
Definition: validator.hh:257
void print(std::ostream &s) const
Definition: validator.hh:171
const T threshold_
Definition: validator.hh:209
ValidateInterval(const ThisType &other)
Definition: validator.hh:227
Definition: validator.hh:17
ValidateGreater(const T &threshold)
Definition: validator.hh:93
void print(std::ostream &s) const
Definition: validator.hh:43
Definition: validator.hh:151
const T threshold_
Definition: validator.hh:113
void print(std::ostream &s) const
Definition: validator.hh:240
Definition: validator.hh:86
ValidateGreater(const ThisType &other)
Definition: validator.hh:97
void print(std::ostream &s) const
Definition: validator.hh:107
ValidatorDefault()
Definition: validator.hh:72
void print(std::ostream &s) const
Definition: validator.hh:139