Candidate_v1.7.0
        stable
      
      
        
          | Last change
 on this file since e9f307 was             8f130c, checked in by Michael Ankele <ankele@…>, 13 years ago | 
        
          | 
made Validators comparable
 | 
        
          | 
              
Property                 mode
 set to                 100644 | 
        
          | File size:
            798 bytes | 
      
      
| Line |  | 
|---|
| 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 |  | 
|---|
| 17 | #include "Validator.hpp" | 
|---|
| 18 |  | 
|---|
| 19 | /** A validator test that always passes. | 
|---|
| 20 | * | 
|---|
| 21 | */ | 
|---|
| 22 | template <class T> | 
|---|
| 23 | class DummyValidator : public Validator<T> | 
|---|
| 24 | { | 
|---|
| 25 | public: | 
|---|
| 26 | DummyValidator(){}; | 
|---|
| 27 | virtual ~DummyValidator() {}; | 
|---|
| 28 |  | 
|---|
| 29 | bool isValid(const T & _value) const | 
|---|
| 30 | { return true;  } | 
|---|
| 31 |  | 
|---|
| 32 |  | 
|---|
| 33 | Validator<T>* clone() const { return new DummyValidator<T>; }; | 
|---|
| 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 | }; | 
|---|
| 43 | }; | 
|---|
| 44 |  | 
|---|
| 45 |  | 
|---|
| 46 | #endif /* DUMMYVALIDATOR_HPP_ */ | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.