From 5c75ee2a98b1b4c03dffc6d0dad67b4c8eaf3c39 Mon Sep 17 00:00:00 2001
From: Rainer Kartmann <rainer.kartmann@kit.edu>
Date: Fri, 30 Apr 2021 13:43:35 +0200
Subject: [PATCH] Fix Prov/CoreSegment ctors and ops

---
 .../armem/core/base/CoreSegmentBase.h          | 16 ++++------------
 .../armem/core/base/ProviderSegmentBase.h      | 18 ++++--------------
 .../armem/core/diskmemory/CoreSegment.cpp      | 12 ------------
 .../armem/core/diskmemory/CoreSegment.h        |  3 +--
 .../armem/core/diskmemory/ProviderSegment.cpp  | 13 -------------
 .../armem/core/diskmemory/ProviderSegment.h    |  3 +--
 .../armem/core/longtermmemory/CoreSegment.cpp  |  6 ------
 .../armem/core/longtermmemory/CoreSegment.h    |  2 +-
 .../core/longtermmemory/ProviderSegment.cpp    |  6 ------
 .../core/longtermmemory/ProviderSegment.h      |  2 +-
 .../armem/core/workingmemory/CoreSegment.cpp   |  9 ---------
 .../armem/core/workingmemory/CoreSegment.h     |  8 ++++++--
 .../core/workingmemory/ProviderSegment.cpp     |  9 ---------
 .../armem/core/workingmemory/ProviderSegment.h |  8 ++++++--
 14 files changed, 24 insertions(+), 91 deletions(-)

diff --git a/source/RobotAPI/libraries/armem/core/base/CoreSegmentBase.h b/source/RobotAPI/libraries/armem/core/base/CoreSegmentBase.h
index 8b3d0ee2c..4c4e50c92 100644
--- a/source/RobotAPI/libraries/armem/core/base/CoreSegmentBase.h
+++ b/source/RobotAPI/libraries/armem/core/base/CoreSegmentBase.h
@@ -53,19 +53,11 @@ namespace armarx::armem::base
         {
         }
 
-        /*
-        CoreSegmentBase(const CoreSegmentBase& other) :
-            Base(other),
-            AronTyped(other)
-        {
-        }
+        CoreSegmentBase(const CoreSegmentBase& other) = default;
+        CoreSegmentBase(CoreSegmentBase&& other) = default;
+        CoreSegmentBase& operator=(const CoreSegmentBase& other) = default;
+        CoreSegmentBase& operator=(CoreSegmentBase&& other) = default;
 
-        CoreSegmentBase& operator=(const CoreSegmentBase& other)
-        {
-            other._copySelf(*this);
-            return *this;
-        }
-        */
 
         inline const std::string& name() const
         {
diff --git a/source/RobotAPI/libraries/armem/core/base/ProviderSegmentBase.h b/source/RobotAPI/libraries/armem/core/base/ProviderSegmentBase.h
index 5e29186c1..81be753a7 100644
--- a/source/RobotAPI/libraries/armem/core/base/ProviderSegmentBase.h
+++ b/source/RobotAPI/libraries/armem/core/base/ProviderSegmentBase.h
@@ -53,20 +53,10 @@ namespace armarx::armem::base
         {
         }
 
-        /*
-        ProviderSegmentBase(const ProviderSegmentBase& other) :
-            Base(other),
-            AronTyped(other)
-        {
-        }
-
-
-        ProviderSegmentBase& operator=(const ProviderSegmentBase& other)
-        {
-            other._copySelf(*this);
-            return *this;
-        }
-        */
+        ProviderSegmentBase(const ProviderSegmentBase& other) = default;
+        ProviderSegmentBase(ProviderSegmentBase&& other) = default;
+        ProviderSegmentBase& operator=(const ProviderSegmentBase& other) = default;
+        ProviderSegmentBase& operator=(ProviderSegmentBase&& other) = default;
 
 
         inline const std::string& name() const
diff --git a/source/RobotAPI/libraries/armem/core/diskmemory/CoreSegment.cpp b/source/RobotAPI/libraries/armem/core/diskmemory/CoreSegment.cpp
index d98f3a339..6a26be9c7 100644
--- a/source/RobotAPI/libraries/armem/core/diskmemory/CoreSegment.cpp
+++ b/source/RobotAPI/libraries/armem/core/diskmemory/CoreSegment.cpp
@@ -8,18 +8,6 @@
 namespace armarx::armem::d_ltm
 {
 
-    CoreSegment::CoreSegment(const CoreSegment& other) :
-        Base(other),
-        path(other.path)
-    {
-    }
-
-    CoreSegment& CoreSegment::operator=(const CoreSegment& other)
-    {
-        other._copySelf(*this);
-        return *this;
-    }
-
     std::filesystem::path CoreSegment::_fullPath() const
     {
         if (path)
diff --git a/source/RobotAPI/libraries/armem/core/diskmemory/CoreSegment.h b/source/RobotAPI/libraries/armem/core/diskmemory/CoreSegment.h
index 896be9776..76bb297e7 100644
--- a/source/RobotAPI/libraries/armem/core/diskmemory/CoreSegment.h
+++ b/source/RobotAPI/libraries/armem/core/diskmemory/CoreSegment.h
@@ -22,9 +22,8 @@ namespace armarx::armem::d_ltm
     public:
 
         using Base::CoreSegmentBase;
+        using Base::operator=;
 
-        CoreSegment(const CoreSegment& other);
-        CoreSegment& operator=(const CoreSegment& other);
 
         // Conversion
         wm::CoreSegment convert() const;
diff --git a/source/RobotAPI/libraries/armem/core/diskmemory/ProviderSegment.cpp b/source/RobotAPI/libraries/armem/core/diskmemory/ProviderSegment.cpp
index 04d906cca..2d5ed3d4a 100644
--- a/source/RobotAPI/libraries/armem/core/diskmemory/ProviderSegment.cpp
+++ b/source/RobotAPI/libraries/armem/core/diskmemory/ProviderSegment.cpp
@@ -7,19 +7,6 @@
 
 namespace armarx::armem::d_ltm
 {
-
-    ProviderSegment::ProviderSegment(const ProviderSegment& other) :
-        Base(other),
-        path(other.path)
-    {
-    }
-
-    ProviderSegment& ProviderSegment::operator=(const ProviderSegment& other)
-    {
-        other._copySelf(*this);
-        return *this;
-    }
-
     std::filesystem::path ProviderSegment::_fullPath() const
     {
         if (path)
diff --git a/source/RobotAPI/libraries/armem/core/diskmemory/ProviderSegment.h b/source/RobotAPI/libraries/armem/core/diskmemory/ProviderSegment.h
index 0be4a70c1..8ad96ea06 100644
--- a/source/RobotAPI/libraries/armem/core/diskmemory/ProviderSegment.h
+++ b/source/RobotAPI/libraries/armem/core/diskmemory/ProviderSegment.h
@@ -22,9 +22,8 @@ namespace armarx::armem::d_ltm
     public:
 
         using Base::ProviderSegmentBase;
+        using Base::operator=;
 
-        ProviderSegment(const ProviderSegment& other);
-        ProviderSegment& operator=(const ProviderSegment& other);
 
         // Conversion
         wm::ProviderSegment convert(const aron::typenavigator::NavigatorPtr& expectedStructure) const;
diff --git a/source/RobotAPI/libraries/armem/core/longtermmemory/CoreSegment.cpp b/source/RobotAPI/libraries/armem/core/longtermmemory/CoreSegment.cpp
index 2cd7aa55c..78f275fe1 100644
--- a/source/RobotAPI/libraries/armem/core/longtermmemory/CoreSegment.cpp
+++ b/source/RobotAPI/libraries/armem/core/longtermmemory/CoreSegment.cpp
@@ -8,12 +8,6 @@
 namespace armarx::armem::ltm
 {
 
-    CoreSegment& CoreSegment::operator=(const CoreSegment& other)
-    {
-        other._copySelf(*this);
-        return *this;
-    }
-
     wm::CoreSegment CoreSegment::convert() const
     {
         wm::CoreSegment m;
diff --git a/source/RobotAPI/libraries/armem/core/longtermmemory/CoreSegment.h b/source/RobotAPI/libraries/armem/core/longtermmemory/CoreSegment.h
index f2ee3dc72..67f9da6f4 100644
--- a/source/RobotAPI/libraries/armem/core/longtermmemory/CoreSegment.h
+++ b/source/RobotAPI/libraries/armem/core/longtermmemory/CoreSegment.h
@@ -21,8 +21,8 @@ namespace armarx::armem::ltm
     public:
 
         using Base::CoreSegmentBase;
+        using Base::operator=;
 
-        CoreSegment& operator=(const CoreSegment& other);
 
         // Conversion
         wm::CoreSegment convert() const;
diff --git a/source/RobotAPI/libraries/armem/core/longtermmemory/ProviderSegment.cpp b/source/RobotAPI/libraries/armem/core/longtermmemory/ProviderSegment.cpp
index 80e618786..38f2a1429 100644
--- a/source/RobotAPI/libraries/armem/core/longtermmemory/ProviderSegment.cpp
+++ b/source/RobotAPI/libraries/armem/core/longtermmemory/ProviderSegment.cpp
@@ -8,12 +8,6 @@
 namespace armarx::armem::ltm
 {
 
-    ProviderSegment& ProviderSegment::operator=(const ProviderSegment& other)
-    {
-        other._copySelf(*this);
-        return *this;
-    }
-
     wm::ProviderSegment ProviderSegment::convert() const
     {
         wm::ProviderSegment m;
diff --git a/source/RobotAPI/libraries/armem/core/longtermmemory/ProviderSegment.h b/source/RobotAPI/libraries/armem/core/longtermmemory/ProviderSegment.h
index 7b3cbcc01..4e81db8a9 100644
--- a/source/RobotAPI/libraries/armem/core/longtermmemory/ProviderSegment.h
+++ b/source/RobotAPI/libraries/armem/core/longtermmemory/ProviderSegment.h
@@ -21,8 +21,8 @@ namespace armarx::armem::ltm
     public:
 
         using Base::ProviderSegmentBase;
+        using Base::operator=;
 
-        ProviderSegment& operator=(const ProviderSegment& other);
 
         // Conversion
         wm::ProviderSegment convert() const;
diff --git a/source/RobotAPI/libraries/armem/core/workingmemory/CoreSegment.cpp b/source/RobotAPI/libraries/armem/core/workingmemory/CoreSegment.cpp
index 21889472f..b4341c9da 100644
--- a/source/RobotAPI/libraries/armem/core/workingmemory/CoreSegment.cpp
+++ b/source/RobotAPI/libraries/armem/core/workingmemory/CoreSegment.cpp
@@ -7,15 +7,6 @@
 
 namespace armarx::armem::wm
 {
-
-    /*
-        CoreSegment& CoreSegment::operator=(const CoreSegment& other)
-        {
-            other._copySelf(*this);
-            return *this;
-        }
-        */
-
     void CoreSegment::_copySelfWithoutData(CoreSegment& other) const
     {
         other.id() = _id;
diff --git a/source/RobotAPI/libraries/armem/core/workingmemory/CoreSegment.h b/source/RobotAPI/libraries/armem/core/workingmemory/CoreSegment.h
index 74b168235..1eaf32733 100644
--- a/source/RobotAPI/libraries/armem/core/workingmemory/CoreSegment.h
+++ b/source/RobotAPI/libraries/armem/core/workingmemory/CoreSegment.h
@@ -21,9 +21,13 @@ namespace armarx::armem::wm
     public:
 
         using Base::CoreSegmentBase;
-        virtual ~CoreSegment() override = default;
 
-        // CoreSegment& operator=(const CoreSegment& other);
+        CoreSegment(const CoreSegment& other) = default;
+        CoreSegment(CoreSegment&& other) = default;
+        CoreSegment& operator=(const CoreSegment& other) = default;
+        CoreSegment& operator=(CoreSegment&& other) = default;
+
+        virtual ~CoreSegment() override = default;
 
 
     protected:
diff --git a/source/RobotAPI/libraries/armem/core/workingmemory/ProviderSegment.cpp b/source/RobotAPI/libraries/armem/core/workingmemory/ProviderSegment.cpp
index 13d70a332..517b35bfa 100644
--- a/source/RobotAPI/libraries/armem/core/workingmemory/ProviderSegment.cpp
+++ b/source/RobotAPI/libraries/armem/core/workingmemory/ProviderSegment.cpp
@@ -8,15 +8,6 @@
 namespace armarx::armem::wm
 {
 
-    /*
-        ProviderSegment& ProviderSegment::operator=(const ProviderSegment& other)
-        {
-            other._copySelf(*this);
-            return *this;
-        }
-        */
-
-
     void ProviderSegment::_copySelfWithoutData(ProviderSegment& other) const
     {
         other.id() = _id;
diff --git a/source/RobotAPI/libraries/armem/core/workingmemory/ProviderSegment.h b/source/RobotAPI/libraries/armem/core/workingmemory/ProviderSegment.h
index 30e9e6e99..0b703617d 100644
--- a/source/RobotAPI/libraries/armem/core/workingmemory/ProviderSegment.h
+++ b/source/RobotAPI/libraries/armem/core/workingmemory/ProviderSegment.h
@@ -22,9 +22,13 @@ namespace armarx::armem::wm
     public:
 
         using Base::ProviderSegmentBase;
-        virtual ~ProviderSegment() override = default;
 
-        // ProviderSegment& operator=(const ProviderSegment& other);
+        ProviderSegment(const ProviderSegment& other) = default;
+        ProviderSegment(ProviderSegment&& other) = default;
+        ProviderSegment& operator=(const ProviderSegment& other) = default;
+        ProviderSegment& operator=(ProviderSegment&& other) = default;
+
+        virtual ~ProviderSegment() override = default;
 
 
     protected:
-- 
GitLab