Node::SPtr createRootNode(Simulation::SPtr s, const std::string& name, const std::map<std::string, std::string>& params) { Node::SPtr root = s->createNewNode(name) ; BaseObjectDescription desc(name.c_str(), "Node"); for(auto& kv : params) { desc.setAttribute(kv.first.c_str(), kv.second); } root->parse(&desc) ; return root ; }
Node::SPtr createChild(Node::SPtr node, BaseObjectDescription& desc) { Node::SPtr tmp = node->createChild(desc.getName()); tmp->parse(&desc); return tmp; }