Skip to content

Commit

Permalink
compile ok, start encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
payetvin committed Dec 11, 2024
1 parent 493a629 commit 4b8cd4b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/solver/systemParser/encoders.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,20 @@
namespace YAML
{

template<>
struct convert<Antares::Solver::SystemParser::Parameter>
{
static bool decode(const Node& node, Antares::Solver::SystemParser::Parameter& rhs)
{
if (!node.IsMap())
{
return false;
}
rhs.id = node["id"].as<std::string>();
rhs.type = node["type"].as<std::string>();
rhs.value = node["value"].as<std::string>();
return true;
}
};

} // namespace YAML
3 changes: 2 additions & 1 deletion src/solver/systemParser/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ System Parser::parse(const std::string& content)
{
YAML::Node root = YAML::Load(content);

System system = root["system"].as<System>();
/* System system = root["system"].as<System>(); */
System system;

return system;
}
Expand Down

0 comments on commit 4b8cd4b

Please sign in to comment.