gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-252-gf9a3f78
a Global And Modular Bsm Inference Tool
yaml_variadic_functions.hpp
Go to the documentation of this file.
1 // GAMBIT: Global and Modular BSM Inference Tool
2 // *********************************************
19 //
29 
30 #ifndef YAML_VARIADIC_FUNCTIONS_HPP
31 #define YAML_VARIADIC_FUNCTIONS_HPP
32 
33 #include <string>
34 
35 #include "yaml-cpp/yaml.h"
36 
37 namespace Gambit
38 {
40  //Variadic Node functions
42 
43  inline const YAML::Node getVariadicNode(const YAML::Node &node)
44  {
45  return node;
46  }
47 
48  inline const YAML::Node getVariadicNode(const YAML::Node &node, std::string key)
49  {
50  return node[key];
51  }
52 
53  template <typename... args>
54  inline const YAML::Node getVariadicNode(const YAML::Node &node, const std::string &key, const args&... keys)
55  {
56  if(not node[key]) return node[key];
57  else return getVariadicNode(node[key], keys...);
58  }
59 
60 }
61 
62 #endif
const YAML::Node getVariadicNode(const YAML::Node &node)
TODO: see if we can use this one:
Definition: Analysis.hpp:33