stlnode.h
Go to the documentation of this file.
1 #ifndef STLNODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM
2 #define STLNODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM
3 
4 #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
5 #pragma once
6 #endif
7 
8 
9 #include <vector>
10 #include <map>
11 
12 namespace YAML_PM
13 {
14  template <typename T>
15  void operator >> (const Node& node, std::vector<T>& v)
16  {
17  v.clear();
18  v.resize(node.size());
19  for(unsigned i=0;i<node.size();++i)
20  node[i] >> v[i];
21  }
22 
23 
24  template <typename K, typename V>
25  void operator >> (const Node& node, std::map<K, V>& m)
26  {
27  m.clear();
28  for(Iterator it=node.begin();it!=node.end();++it) {
29  K k;
30  V v;
31  it.first() >> k;
32  it.second() >> v;
33  m[k] = v;
34  }
35  }
36 }
37 
38 #endif // STLNODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM
std::size_t size() const
Definition: node.cpp:178
Iterator begin() const
Definition: node.cpp:141
Iterator end() const
Definition: node.cpp:159
void operator>>(const Node &node, Binary &binary)
Definition: binary.cpp:95


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