Registrar.cpp
Go to the documentation of this file.
1 #include "PointMatcher.h"
2 
3 #ifdef SYSTEM_YAML_CPP
4  #include "yaml-cpp/yaml.h"
5 #else
6  #include "yaml-cpp-pm/yaml.h"
7  namespace YAML = YAML_PM;
8 #endif // HAVE_YAML_CPP
9 
10 namespace PointMatcherSupport
11 {
13  {
14  if (module.size() != 1)
15  {
16  // parameter-less entry
17  name = module.to<std::string>();
18  }
19  else
20  {
21  // get parameters
22  YAML::Iterator mapIt(module.begin());
23  mapIt.first() >> name;
24  for(YAML::Iterator paramIt = mapIt.second().begin(); paramIt != mapIt.second().end(); ++paramIt)
25  {
26  std::string key, value;
27  paramIt.first() >> key;
28  paramIt.second() >> value;
29  params[key] = value;
30  }
31  }
32  }
33 }
public interface
::std::string string
Definition: gtest.h:1979
std::size_t size() const
Definition: node.cpp:178
Iterator begin() const
Definition: node.cpp:141
std::map< std::string, Parameter > Parameters
Parameters stored as a map of string->string.
Functions and classes that are not dependant on scalar type are defined in this namespace.
void getNameParamsFromYAML(const YAML::Node &module, std::string &name, Parametrizable::Parameters &params)
Retrieve name and parameters from a yaml node.
Definition: Registrar.cpp:12
Iterator end() const
Definition: node.cpp:159
const Node & second() const
Definition: iterator.cpp:78
const Node & first() const
Definition: iterator.cpp:70
const T to() const
Definition: nodeimpl.h:16


libpointmatcher
Author(s):
autogenerated on Sat May 27 2023 02:38:03