3rdparty
libpointmatcher
contrib
yaml-cpp-pm
src
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
{
15
enum
value
{
None
,
BlockMap
,
BlockSeq
,
FlowMap
,
FlowSeq
,
CompactMap
};
16
};
17
18
class
CollectionStack
19
{
20
public
:
21
CollectionType::value
GetCurCollectionType
()
const
{
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
YAML_PM::CollectionType::BlockMap
@ BlockMap
Definition:
collectionstack.h:15
YAML_PM::CollectionStack::GetCurCollectionType
CollectionType::value GetCurCollectionType() const
Definition:
collectionstack.h:21
YAML_PM
Definition:
aliasmanager.h:11
YAML_PM::CollectionType::value
value
Definition:
collectionstack.h:15
YAML_PM::CollectionType::FlowSeq
@ FlowSeq
Definition:
collectionstack.h:15
YAML_PM::CollectionStack::PushCollectionType
void PushCollectionType(CollectionType::value type)
Definition:
collectionstack.h:27
YAML_PM::CollectionStack::PopCollectionType
void PopCollectionType(CollectionType::value type)
Definition:
collectionstack.h:28
YAML_PM::CollectionStack
Definition:
collectionstack.h:18
YAML_PM::CollectionType::CompactMap
@ CompactMap
Definition:
collectionstack.h:15
YAML_PM::CollectionType
Definition:
collectionstack.h:14
YAML_PM::CollectionType::BlockSeq
@ BlockSeq
Definition:
collectionstack.h:15
YAML_PM::CollectionType::None
@ None
Definition:
collectionstack.h:15
YAML_PM::CollectionStack::collectionStack
std::stack< CollectionType::value > collectionStack
Definition:
collectionstack.h:31
YAML_PM::CollectionType::FlowMap
@ FlowMap
Definition:
collectionstack.h:15
mp2p_icp
Author(s):
autogenerated on Fri Dec 20 2024 03:45:57