5 #define DEPRECATION_TO_ICE "This function is deprecated. Use armarx::toIce() from <ArmarXCore/core/ice_conversions.h> instead."
6 #define DEPRECATION_FROM_ICE "This function is deprecated. Use armarx::fromIce() from <ArmarXCore/core/ice_conversions.h> instead."
28 template <
class IceT,
class CppT>
35 template <
class IceT,
class CppT>
37 void fromIce(const ::IceInternal::Handle<IceT>& ice, CppT&
cpp)
47 template <
class IceT,
class CppT>
55 template <
class CppT,
class IceT>
66 template <
class IceT,
class CppT>
68 void toIce(IceT& ice,
const std::unique_ptr<CppT>& cppPointer)
72 toIce(ice, *cppPointer);
75 template <
class IceT,
class CppT>
77 void fromIce(
const IceT& ice, std::unique_ptr<CppT>& cppPointer)
79 cppPointer = std::make_unique<CppT>();
86 template <
class IceT,
class CppT>
93 toIce(*ice, *cppPointer);
100 template <
class IceT,
class CppT>
102 void fromIce(const ::IceInternal::Handle<IceT>& ice, std::unique_ptr<CppT>& cppPointer)
106 cppPointer = std::make_unique<CppT>();
111 cppPointer =
nullptr;
118 template <
class IceT,
class CppT>
120 void toIce(std::vector<IceT>& ices,
const std::vector<CppT>& cpps)
123 ices.reserve(cpps.size());
124 for (
const auto&
cpp : cpps)
129 template <
class IceT,
class CppT>
131 void fromIce(
const std::vector<IceT>& ices, std::vector<CppT>& cpps)
134 cpps.reserve(ices.size());
135 for (
const auto& ice : ices)
137 fromIce(ice, cpps.emplace_back());
141 template <
class IceT,
class CppT>
143 std::vector<IceT>
toIce(
const std::vector<CppT>& cpps)
145 std::vector<IceT> ices;
153 template <
class IceKeyT,
class IceValueT,
class CppKeyT,
class CppValueT>
155 void toIce(std::map<IceKeyT, IceValueT>& iceMap,
156 const std::map<CppKeyT, CppValueT>& cppMap)
159 for (
const auto& [key,
value] : cppMap)
161 iceMap.emplace(toIce<IceKeyT>(key), toIce<IceValueT>(
value));
164 template <
class IceKeyT,
class IceValueT,
class CppKeyT,
class CppValueT>
166 void fromIce(
const std::map<IceKeyT, IceValueT>& iceMap,
167 std::map<CppKeyT, CppValueT>& cppMap)
170 for (
const auto& [key,
value] : iceMap)
172 cppMap.emplace(fromIce<CppKeyT>(key), fromIce<CppValueT>(
value));
176 template <
class IceKeyT,
class IceValueT,
class CppKeyT,
class CppValueT>
178 std::map<IceKeyT, IceValueT>
toIce(
const std::map<CppKeyT, CppValueT>& cppMap)
180 std::map<IceKeyT, IceValueT> iceMap;
181 toIce(iceMap, cppMap);