From 6b7bdc633736550baa88e64138bae0ada0ec70a3 Mon Sep 17 00:00:00 2001
From: Rainer Kartmann <rainer.kartmann@kit.edu>
Date: Wed, 23 Jun 2021 08:20:48 +0200
Subject: [PATCH] Add overload taking ice types

---
 .../client/MemoryNameSystemComponentPlugin.cpp    |  4 +---
 .../armem/client/util/MemoryListener.cpp          | 15 +++++++++++++--
 .../libraries/armem/client/util/MemoryListener.h  |  1 +
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/source/RobotAPI/libraries/armem/client/MemoryNameSystemComponentPlugin.cpp b/source/RobotAPI/libraries/armem/client/MemoryNameSystemComponentPlugin.cpp
index e97ec6af0..1d24d974e 100644
--- a/source/RobotAPI/libraries/armem/client/MemoryNameSystemComponentPlugin.cpp
+++ b/source/RobotAPI/libraries/armem/client/MemoryNameSystemComponentPlugin.cpp
@@ -90,10 +90,8 @@ namespace armarx::armem::client
     }
 
     void MemoryNameSystemComponentPluginUser::memoryUpdated(
-        const std::vector<data::MemoryID>& updatedSnapshotIDsIce, const Ice::Current&)
+        const std::vector<data::MemoryID>& updatedSnapshotIDs, const Ice::Current&)
     {
-        std::vector<MemoryID> updatedSnapshotIDs;
-        fromIce(updatedSnapshotIDsIce, updatedSnapshotIDs);
         memoryNameSystem.updated(updatedSnapshotIDs);
     }
 
diff --git a/source/RobotAPI/libraries/armem/client/util/MemoryListener.cpp b/source/RobotAPI/libraries/armem/client/util/MemoryListener.cpp
index 996129960..2c491c11f 100644
--- a/source/RobotAPI/libraries/armem/client/util/MemoryListener.cpp
+++ b/source/RobotAPI/libraries/armem/client/util/MemoryListener.cpp
@@ -3,6 +3,7 @@
 #include <sstream>
 
 #include <ArmarXCore/core/logging/Logging.h>
+#include <RobotAPI/libraries/armem/core/ice_conversions.h>
 #include <RobotAPI/libraries/armem/core/error.h>
 
 
@@ -14,6 +15,15 @@ namespace armarx::armem::client::util
     }
 
 
+    void
+    MemoryListener::updated(const std::vector<data::MemoryID>& updatedSnapshotIDs) const
+    {
+        std::vector<MemoryID> bos;
+        fromIce(updatedSnapshotIDs, bos);
+        updated(bos);
+    }
+
+
     void
     MemoryListener::updated(const std::vector<MemoryID>& updatedSnapshotIDs) const
     {
@@ -58,13 +68,14 @@ namespace armarx::armem::client::util
 
 
     void
-    MemoryListener::subscribe(const MemoryID& id, callback callback)
+    MemoryListener::subscribe(const MemoryID& id, Callback callback)
     {
         callbacks[id].push_back(callback);
     }
 
 
-    void MemoryListener::subscribe(const MemoryID& subscriptionID, CallbackUpdatedOnly callback)
+    void
+    MemoryListener::subscribe(const MemoryID& subscriptionID, CallbackUpdatedOnly callback)
     {
         subscribe(subscriptionID, [callback](const MemoryID&, const std::vector<MemoryID>& updatedSnapshotIDs)
         {
diff --git a/source/RobotAPI/libraries/armem/client/util/MemoryListener.h b/source/RobotAPI/libraries/armem/client/util/MemoryListener.h
index 7591f1f5d..2d530097c 100644
--- a/source/RobotAPI/libraries/armem/client/util/MemoryListener.h
+++ b/source/RobotAPI/libraries/armem/client/util/MemoryListener.h
@@ -66,6 +66,7 @@ namespace armarx::armem::client::util
 
         /// Function handling updates from the MemoryListener ice topic.
         void updated(const std::vector<MemoryID>& updatedIDs) const;
+        void updated(const std::vector<data::MemoryID>& updatedIDs) const;
 
 
     protected:
-- 
GitLab