Skip to content
Snippets Groups Projects
Commit c6f9cbe2 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Deprecate moved functions

parent d9f5a648
No related branches found
No related tags found
No related merge requests found
#pragma once
#include "Commit.h"
#include <ArmarXCore/core/ice_conversions.h>
#include <Ice/Handle.h>
#include <map>
#include <memory>
#include <vector>
#define DEPRECATION_TO_ICE "This function is deprecated. Use armarx::toIce() from <ArmarXCore/core/ice_conversions.h> instead."
#define DEPRECATION_FROM_ICE "This function is deprecated. Use armarx::fromIce() from <ArmarXCore/core/ice_conversions.h> instead."
namespace armarx::armem
......@@ -14,11 +11,13 @@ namespace armarx::armem
// Same type
template <class T>
[[deprecated(DEPRECATION_TO_ICE)]]
void toIce(T& ice, const T& cpp)
{
ice = cpp;
}
template <class T>
[[deprecated(DEPRECATION_FROM_ICE)]]
void fromIce(const T& ice, T& cpp)
{
cpp = ice;
......@@ -27,12 +26,14 @@ namespace armarx::armem
// Ice Handle
template <class IceT, class CppT>
[[deprecated(DEPRECATION_TO_ICE)]]
void toIce(::IceInternal::Handle<IceT>& ice, const CppT& cpp)
{
ice = new IceT();
toIce(*ice, cpp);
}
template <class IceT, class CppT>
[[deprecated(DEPRECATION_FROM_ICE)]]
void fromIce(const ::IceInternal::Handle<IceT>& ice, CppT& cpp)
{
if (ice)
......@@ -44,6 +45,7 @@ namespace armarx::armem
// General return version
template <class IceT, class CppT>
[[deprecated(DEPRECATION_TO_ICE)]]
IceT toIce(const CppT& cpp)
{
IceT ice;
......@@ -51,6 +53,7 @@ namespace armarx::armem
return ice;
}
template <class CppT, class IceT>
[[deprecated(DEPRECATION_FROM_ICE)]]
CppT fromIce(const IceT& ice)
{
CppT cpp;
......@@ -61,6 +64,7 @@ namespace armarx::armem
// std::unique_ptr
template <class IceT, class CppT>
[[deprecated(DEPRECATION_TO_ICE)]]
void toIce(IceT& ice, const std::unique_ptr<CppT>& cppPointer)
{
if (cppPointer)
......@@ -69,6 +73,7 @@ namespace armarx::armem
}
}
template <class IceT, class CppT>
[[deprecated(DEPRECATION_FROM_ICE)]]
void fromIce(const IceT& ice, std::unique_ptr<CppT>& cppPointer)
{
cppPointer = std::make_unique<CppT>();
......@@ -79,6 +84,7 @@ namespace armarx::armem
// Ice Handle <-> std::unique_ptr
template <class IceT, class CppT>
[[deprecated(DEPRECATION_TO_ICE)]]
void toIce(::IceInternal::Handle<IceT>& ice, const std::unique_ptr<CppT>& cppPointer)
{
if (cppPointer)
......@@ -92,6 +98,7 @@ namespace armarx::armem
}
}
template <class IceT, class CppT>
[[deprecated(DEPRECATION_FROM_ICE)]]
void fromIce(const ::IceInternal::Handle<IceT>& ice, std::unique_ptr<CppT>& cppPointer)
{
if (ice)
......@@ -109,6 +116,7 @@ namespace armarx::armem
// std::vector
template <class IceT, class CppT>
[[deprecated(DEPRECATION_TO_ICE)]]
void toIce(std::vector<IceT>& ices, const std::vector<CppT>& cpps)
{
ices.clear();
......@@ -119,6 +127,7 @@ namespace armarx::armem
}
}
template <class IceT, class CppT>
[[deprecated(DEPRECATION_FROM_ICE)]]
void fromIce(const std::vector<IceT>& ices, std::vector<CppT>& cpps)
{
cpps.clear();
......@@ -130,6 +139,7 @@ namespace armarx::armem
}
template <class IceT, class CppT>
[[deprecated(DEPRECATION_TO_ICE)]]
std::vector<IceT> toIce(const std::vector<CppT>& cpps)
{
std::vector<IceT> ices;
......@@ -141,6 +151,7 @@ namespace armarx::armem
// std::map
template <class IceKeyT, class IceValueT, class CppKeyT, class CppValueT>
[[deprecated(DEPRECATION_TO_ICE)]]
void toIce(std::map<IceKeyT, IceValueT>& iceMap,
const std::map<CppKeyT, CppValueT>& cppMap)
{
......@@ -151,6 +162,7 @@ namespace armarx::armem
}
}
template <class IceKeyT, class IceValueT, class CppKeyT, class CppValueT>
[[deprecated(DEPRECATION_FROM_ICE)]]
void fromIce(const std::map<IceKeyT, IceValueT>& iceMap,
std::map<CppKeyT, CppValueT>& cppMap)
{
......@@ -162,6 +174,7 @@ namespace armarx::armem
}
template <class IceKeyT, class IceValueT, class CppKeyT, class CppValueT>
[[deprecated(DEPRECATION_TO_ICE)]]
std::map<IceKeyT, IceValueT> toIce(const std::map<CppKeyT, CppValueT>& cppMap)
{
std::map<IceKeyT, IceValueT> iceMap;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment