source:
src/Parameters/Validators/DummyValidator.hpp@
a844d8
| Last change on this file since a844d8 was 8f130c, checked in by , 14 years ago | |
|---|---|
|
|
| File size: 798 bytes | |
| Rev | Line | |
|---|---|---|
| [0ba371] | 1 | /* |
| 2 | * DummyValidator.hpp | |
| 3 | * | |
| 4 | * Created on: Apr 13, 2012 | |
| 5 | * Author: ankele | |
| 6 | */ | |
| 7 | ||
| 8 | #ifndef DUMMYVALIDATOR_HPP_ | |
| 9 | #define DUMMYVALIDATOR_HPP_ | |
| 10 | ||
| 11 | ||
| 12 | // include config.h | |
| 13 | #ifdef HAVE_CONFIG_H | |
| 14 | #include <config.h> | |
| 15 | #endif | |
| 16 | ||
| [a9a8f9] | 17 | #include "Validator.hpp" |
| 18 | ||
| [0ba371] | 19 | /** A validator test that always passes. |
| 20 | * | |
| 21 | */ | |
| 22 | template <class T> | |
| [a9a8f9] | 23 | class DummyValidator : public Validator<T> |
| [0ba371] | 24 | { |
| 25 | public: | |
| [20fdc5] | 26 | DummyValidator(){}; |
| [0ba371] | 27 | virtual ~DummyValidator() {}; |
| 28 | ||
| [4892c3] | 29 | bool isValid(const T & _value) const |
| [0ba371] | 30 | { return true; } |
| [a9a8f9] | 31 | |
| 32 | ||
| 33 | Validator<T>* clone() const { return new DummyValidator<T>; }; | |
| [8f130c] | 34 | |
| 35 | // comparator | |
| 36 | bool operator==(const Validator<T> &_instance) const | |
| 37 | { | |
| 38 | const DummyValidator<T> *inst = dynamic_cast<const DummyValidator<T> *>(&_instance); | |
| 39 | if (inst) | |
| 40 | return true; | |
| 41 | return false; | |
| 42 | }; | |
| [0ba371] | 43 | }; |
| 44 | ||
| 45 | ||
| 46 | #endif /* DUMMYVALIDATOR_HPP_ */ |
Note:
See TracBrowser
for help on using the repository browser.
