37 lines
766 B
C
37 lines
766 B
C
|
#ifndef DOMAIN_FUNCTION_VALIDATOR_H
|
||
|
#define DOMAIN_FUNCTION_VALIDATOR_H
|
||
|
|
||
|
#include<functional>
|
||
|
#include<vector>
|
||
|
|
||
|
#include "value.h"
|
||
|
|
||
|
namespace domain {
|
||
|
|
||
|
class FunctionValidator {
|
||
|
private:
|
||
|
std::string name;
|
||
|
std::vector<Value::ValueType> signature;
|
||
|
|
||
|
protected:
|
||
|
FunctionValidator(std::string name, std::vector<Value::ValueType> signature);
|
||
|
|
||
|
public:
|
||
|
|
||
|
std::string getName();
|
||
|
|
||
|
std::vector<Value::ValueType> getSignature();
|
||
|
|
||
|
bool validateSignature(std::vector<Value> signature);
|
||
|
|
||
|
virtual bool validate(std::vector<Value> values) = 0;
|
||
|
|
||
|
virtual void clear() = 0;
|
||
|
};
|
||
|
|
||
|
std::vector<FunctionValidator *> getSupportedValidators();
|
||
|
|
||
|
} // namespace domain
|
||
|
|
||
|
#endif // DOMAIN_FUNCTION_VALIDATOR_H
|