collectionstack.h
Go to the documentation of this file.
1 #ifndef COLLECTIONSTACK_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM
2 #define COLLECTIONSTACK_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 <stack>
10 #include <cassert>
11 
12 namespace YAML_PM
13 {
14  struct CollectionType {
16  };
17 
19  {
20  public:
22  if(collectionStack.empty())
23  return CollectionType::None;
24  return collectionStack.top();
25  }
26 
27  void PushCollectionType(CollectionType::value type) { collectionStack.push(type); }
28  void PopCollectionType(CollectionType::value type) { assert(type == GetCurCollectionType()); collectionStack.pop(); }
29 
30  private:
31  std::stack<CollectionType::value> collectionStack;
32  };
33 }
34 
35 #endif // COLLECTIONSTACK_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM
CollectionType::value GetCurCollectionType() const
void PushCollectionType(CollectionType::value type)
void PopCollectionType(CollectionType::value type)
std::stack< CollectionType::value > collectionStack


libpointmatcher
Author(s):
autogenerated on Sat May 27 2023 02:36:30