From 4b8cd4bd9296e307509387becdef4d3339964803 Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Wed, 11 Dec 2024 11:20:38 +0100 Subject: [PATCH] compile ok, start encoder --- src/solver/systemParser/encoders.hxx | 16 ++++++++++++++++ src/solver/systemParser/parser.cpp | 3 ++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/solver/systemParser/encoders.hxx b/src/solver/systemParser/encoders.hxx index d4ce1b9718..e53c4ff237 100644 --- a/src/solver/systemParser/encoders.hxx +++ b/src/solver/systemParser/encoders.hxx @@ -29,4 +29,20 @@ namespace YAML { +template<> +struct convert +{ + static bool decode(const Node& node, Antares::Solver::SystemParser::Parameter& rhs) + { + if (!node.IsMap()) + { + return false; + } + rhs.id = node["id"].as(); + rhs.type = node["type"].as(); + rhs.value = node["value"].as(); + return true; + } +}; + } // namespace YAML diff --git a/src/solver/systemParser/parser.cpp b/src/solver/systemParser/parser.cpp index c29cb8837c..9bd1db7626 100644 --- a/src/solver/systemParser/parser.cpp +++ b/src/solver/systemParser/parser.cpp @@ -32,7 +32,8 @@ System Parser::parse(const std::string& content) { YAML::Node root = YAML::Load(content); - System system = root["system"].as(); + /* System system = root["system"].as(); */ + System system; return system; }