SurgSim
DataStructures
DataStructuresConvert.h
Go to the documentation of this file.
1
// This file is a part of the OpenSurgSim project.
2
// Copyright 2013, SimQuest Solutions Inc.
3
//
4
// Licensed under the Apache License, Version 2.0 (the "License");
5
// you may not use this file except in compliance with the License.
6
// You may obtain a copy of the License at
7
//
8
// http://www.apache.org/licenses/LICENSE-2.0
9
//
10
// Unless required by applicable law or agreed to in writing, software
11
// distributed under the License is distributed on an "AS IS" BASIS,
12
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
// See the License for the specific language governing permissions and
14
// limitations under the License.
15
16
#ifndef SURGSIM_DATASTRUCTURES_DATASTRUCTURESCONVERT_H
17
#define SURGSIM_DATASTRUCTURES_DATASTRUCTURESCONVERT_H
18
19
#include <array>
20
#include <memory>
21
#include <unordered_map>
22
#include <unordered_set>
23
#include <yaml-cpp/yaml.h>
24
25
#include "
SurgSim/DataStructures/OptionalValue.h
"
26
#include "
SurgSim/Framework/Macros.h
"
27
28
namespace
YAML
29
{
30
32
SURGSIM_DOUBLE_SPECIALIZATION
33
template
<
class
T>
34
struct
convert
<
SurgSim
::DataStructures::OptionalValue<T>>
35
{
36
static
Node encode(
const
SurgSim::DataStructures::OptionalValue<T>
& rhs);
37
static
bool
decode(
const
Node& node,
SurgSim::DataStructures::OptionalValue<T>
& rhs);
//NOLINT
38
};
39
41
SURGSIM_DOUBLE_SPECIALIZATION
42
template
<
class
Key,
class
T>
43
struct
convert
<std::unordered_map<Key, T>>
44
{
45
static
Node encode(
const
std::unordered_map<Key, T>& rhs);
46
static
bool
decode(
const
Node& node, std::unordered_map<Key, T>& rhs);
//NOLINT
47
};
48
50
SURGSIM_DOUBLE_SPECIALIZATION
51
template
<
class
Value>
52
struct
convert
<std::unordered_set<Value>>
53
{
54
static
Node encode(
const
std::unordered_set<Value>& rhs);
55
static
bool
decode(
const
Node& node, std::unordered_set<Value>& rhs);
//NOLINT
56
};
57
58
}
// namespace YAML
59
60
#include "
SurgSim/DataStructures/DataStructuresConvert-inl.h
"
61
62
#endif // SURGSIM_DATASTRUCTURES_DATASTRUCTURESCONVERT_H
Macros.h
SurgSim::DataStructures::OptionalValue
Container class that can indicate whether the object has been assigned a value.
Definition:
OptionalValue.h:29
OptionalValue.h
YAML
Definition:
DataStructuresConvert.h:28
SURGSIM_DOUBLE_SPECIALIZATION
#define SURGSIM_DOUBLE_SPECIALIZATION
Definition:
Macros.h:44
SurgSim
Definition:
CompoundShapeToGraphics.cpp:29
DataStructuresConvert-inl.h
SurgSim::Framework::convert
SurgSim::Math::Matrix44f convert(boost::any val)
Specialization for convert<T>() to correctly cast Matrix44d to Matrix44f, will throw if the val is no...
Definition:
Accessible.cpp:210
Generated on Sun Feb 9 2020 17:22:37 for OpenSurgSim by
1.8.16