16 #ifndef SURGSIM_FRAMEWORK_FRAMEWORKCONVERT_H
17 #define SURGSIM_FRAMEWORK_FRAMEWORKCONVERT_H
20 #include <unordered_map>
21 #include <yaml-cpp/yaml.h>
46 static YAML::Node encode(
47 const typename std::enable_if <std::is_base_of <SurgSim::Framework::Component, T>::value,
48 std::shared_ptr<T>>::type rhs);
51 typename std::enable_if <std::is_base_of<SurgSim::Framework::Component, T>::value,
52 std::shared_ptr<T>>::type& rhs);
67 struct convert<std::shared_ptr<SurgSim::Framework::Component>>
69 static Node encode(
const std::shared_ptr<SurgSim::Framework::Component> rhs);
70 static bool decode(
const Node& node, std::shared_ptr<SurgSim::Framework::Component>& rhs);
72 typedef std::unordered_map<std::string, std::shared_ptr<SurgSim::Framework::Component>>
RegistryType;
88 struct convert<std::shared_ptr<SurgSim::Framework::SceneElement>>
90 static Node encode(
const std::shared_ptr<SurgSim::Framework::SceneElement> rhs);
91 static bool decode(
const Node& node, std::shared_ptr<SurgSim::Framework::SceneElement>& rhs);
95 struct convert <std::vector<std::shared_ptr<SurgSim::Framework::SceneElement>>>
98 static bool decode(
const Node& node,
99 std::vector<std::shared_ptr<SurgSim::Framework::SceneElement>>& rhs,
100 std::vector<std::string>* stack =
nullptr);
111 struct convert<std::shared_ptr<SurgSim::Framework::Scene>>
113 static Node encode(
const std::shared_ptr<SurgSim::Framework::Scene> rhs);
114 static bool decode(
const Node& node, std::shared_ptr<SurgSim::Framework::Scene>& rhs);
118 struct convert<std::shared_ptr<SurgSim::Framework::Asset>>
120 static Node encode(
const std::shared_ptr<SurgSim::Framework::Asset> rhs);
121 static bool decode(
const Node& node, std::shared_ptr<SurgSim::Framework::Asset>& rhs);
129 #endif // SURGSIM_FRAMEWORK_FRAMEWORKCONVERT_H