#pragma once #include #include #include "yaml-cpp/yaml.h" typedef std::string expressions; enum class ConfigType : char { Label = 'L', Formula = 'F', Module = 'M' }; struct Configuration { expressions expressions_; std::string derivation_; ConfigType type_ {ConfigType::Label}; bool overwrite_; Configuration() = default; Configuration(std::string expression, std::string derivation, ConfigType type, bool overwrite = false) : expressions_(expression), derivation_(derivation), type_(type), overwrite_(overwrite) {} ~Configuration() = default; Configuration(const Configuration&) = default; friend std::ostream& operator << (std::ostream& os, const Configuration& config) { os << "Configuration with Type: " << static_cast(config.type_) << std::endl; os << "\tExpression=" << config.expressions_ << std::endl; return os << "\tDerviation=" << config.derivation_; } }; struct Label { private: public: std::string text_; std::string label_; bool overwrite_; friend std::ostream& operator <<(std::ostream &os, const Label& label); }; struct Formula { private: public: std::string formula_; std::string content_; bool overwrite_; friend std::ostream& operator << (std::ostream &os, const Formula& formula); }; struct Action { public: std::string action_; std::string guard_; std::string update_; bool overwrite_; friend std::ostream& operator << (std::ostream& os, const Action& action); }; struct Module { public: std::vector actions_; std::string module_; friend std::ostream& operator << (std::ostream& os, const Module& module); }; template<> struct YAML::convert { static YAML::Node encode(const Module& rhs); static bool decode(const YAML::Node& node, Module& rhs); }; template<> struct YAML::convert { static YAML::Node encode(const Action& rhs); static bool decode(const YAML::Node& node, Action& rhs); }; template<> struct YAML::convert