/* * ElementValidator.hpp * * Created on: May 9, 2012 * Author: heber */ #ifndef ELEMENTVALIDATOR_HPP_ #define ELEMENTVALIDATOR_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "Parameters/Validators/Validator.hpp" class element; class ElementValidator : public Validator { typedef const element *const_element_ptr; bool isValid(const const_element_ptr & _value) const { return (_value != NULL); } bool operator==(const Validator &_instance) const { const ElementValidator *inst = dynamic_cast(&_instance); if (inst) return true; else return false; } Validator< const element * >* clone() const { Validator< const element * > *inst = new ElementValidator(); return inst; } }; #endif /* ELEMENTVALIDATOR_HPP_ */