DataStructuresConvert.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2013, SimQuest Solutions Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SURGSIM_DATASTRUCTURES_DATASTRUCTURESCONVERT_H
#define SURGSIM_DATASTRUCTURES_DATASTRUCTURESCONVERT_H
#include <array>
#include <memory>
#include <unordered_map>
#include <unordered_set>
#include <yaml-cpp/yaml.h>
#include "SurgSim/DataStructures/OptionalValue.h"
#include "SurgSim/Framework/Macros.h"
namespace YAML
{
SURGSIM_DOUBLE_SPECIALIZATION
template <class T>
struct convert<SurgSim::DataStructures::OptionalValue<T>>
{
static Node encode(const SurgSim::DataStructures::OptionalValue<T>& rhs);
static bool decode(const Node& node, SurgSim::DataStructures::OptionalValue<T>& rhs); //NOLINT
};
SURGSIM_DOUBLE_SPECIALIZATION
template <class Key, class T>
struct convert<std::unordered_map<Key, T>>
{
static Node encode(const std::unordered_map<Key, T>& rhs);
static bool decode(const Node& node, std::unordered_map<Key, T>& rhs); //NOLINT
};
SURGSIM_DOUBLE_SPECIALIZATION
template <class Value>
struct convert<std::unordered_set<Value>>
{
static Node encode(const std::unordered_set<Value>& rhs);
static bool decode(const Node& node, std::unordered_set<Value>& rhs); //NOLINT
};
} // namespace YAML
#include "SurgSim/DataStructures/DataStructuresConvert-inl.h"
#endif // SURGSIM_DATASTRUCTURES_DATASTRUCTURESCONVERT_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
std
STL namespace.
SurgSim::DataStructures::OptionalValue
Container class that can indicate whether the object has been assigned a value.
Definition: OptionalValue.h: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
Macros.h
YAML
Definition: DataStructuresConvert.h:28
OptionalValue.h
SURGSIM_DOUBLE_SPECIALIZATION
#define SURGSIM_DOUBLE_SPECIALIZATION
Definition: Macros.h:44