#ifndef DOMAIN_RULE_H #define DOMAIN_RULE_H #include "addressspace.h" #include "value.h" #include "functionsignature.h" #include #include #include #include namespace domain { struct RuleContext { std::map addressSpaces; std::map attributes; std::map function; }; class Condition { bool negated; std::string function; std::vector params; public: Condition(std::string function, std::vector params, bool negated); bool evaluate(RuleContext &context); }; class Action { public: enum ActionType { ERROR, WARNING }; private: ActionType type; std::string message; public: Action(ActionType type, std::string message); ActionType getType(); std::string getMessage(); }; class IfStatement { Condition condition; Action action; public: IfStatement(Condition condition, Action action); std::optional evaluate(RuleContext &context); }; class Rule { std::vector statements; public: Rule(std::vector statements); std::optional evaluate(RuleContext &context); }; } // namespace domain #endif // DOMAIN_RULE_H