Package: opensurgsim / 0.7.0-8

yaml-cpp_0.6.2.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Description: Adapt to libyaml-cpp 0.6.2.patch
Author: Andreas Tille <tille@debian.org>
Last-Update: Sun, 28 Oct 2018 13:42:42 +0100

--- a/SurgSim/DataStructures/DataStructuresConvert.h
+++ b/SurgSim/DataStructures/DataStructuresConvert.h
@@ -37,15 +37,6 @@ struct convert<SurgSim::DataStructures::
 	static bool decode(const Node& node, SurgSim::DataStructures::OptionalValue<T>& rhs); //NOLINT
 };
 
-/// YAML::convert specialization for std::array.
-SURGSIM_DOUBLE_SPECIALIZATION
-template <class T, size_t N>
-struct convert<std::array<T, N>>
-{
-	static Node encode(const std::array<T, N>& rhs);
-	static bool decode(const Node& node, std::array<T, N>& rhs); //NOLINT
-};
-
 /// YAML::convert specialization for std::unordered_map.
 SURGSIM_DOUBLE_SPECIALIZATION
 template <class Key, class T>
--- a/SurgSim/DataStructures/DataStructuresConvert-inl.h
+++ b/SurgSim/DataStructures/DataStructuresConvert-inl.h
@@ -91,43 +91,6 @@ bool YAML::convert<SurgSim::DataStructur
 	return result;
 }
 
-template <class T, size_t N>
-YAML::Node YAML::convert<std::array<T, N>>::encode(const std::array<T, N>& rhs)
-{
-	Node node(NodeType::Sequence);
-	for (auto it = rhs.cbegin(); it != rhs.cend(); ++it)
-	{
-		node.push_back(*it);
-	}
-	return node;
-}
-
-template <class T, size_t N>
-bool YAML::convert<std::array<T, N>>::decode(const Node& node, std::array<T, N>& rhs) //NOLINT
-{
-	if (!node.IsSequence() || node.size() != N)
-	{
-		return false;
-	}
-
-	bool result = true;
-	auto rhsit = rhs.begin();
-	for (YAML::const_iterator it = node.begin(); it != node.end(); ++it, ++rhsit)
-	{
-		try
-		{
-			(*rhsit) = it->as<T>();
-		}
-		catch (YAML::RepresentationException)
-		{
-			result = false;
-			auto logger = SurgSim::Framework::Logger::getLogger(SurgSim::DataStructures::Convert::serializeLogger);
-			SURGSIM_LOG(logger, WARNING) << __FUNCTION__ << ": Bad conversion";
-		}
-	}
-	return result;
-}
-
 template <class Key, class T>
 YAML::Node YAML::convert<std::unordered_map<Key, T>>::encode(const std::unordered_map<Key, T>& rhs)
 {