#ifndef DOMAIN_FUNCTION_VALIDATOR_H #define DOMAIN_FUNCTION_VALIDATOR_H #include #include #include "value.h" namespace domain { class FunctionValidator { private: std::string name; std::vector signature; protected: FunctionValidator(std::string name, std::vector signature) { this->name = name; this->signature = signature; } public: std::string getName() { return name; } std::vector getSignature() { return signature; } bool validateSignature(std::vector signature) { if(this->signature.size() != signature.size()) { return false; } for(int i=0; isignature.size(); i++) { if(this->signature[i] != signature[i].getType()) { return false; } } return true; } virtual bool validate(std::vector values) = 0; virtual void clear() = 0; }; std::vector getSupportedValidators(); } // namespace domain #endif // DOMAIN_FUNCTION_VALIDATOR_H