fix missing-override warnings on Scilab types
[scilab.git] / scilab / modules / scicos / src / cpp / view_scilab / BaseAdapter.hxx
index 154c6f5..6db39d7 100644 (file)
@@ -23,7 +23,6 @@
 #include <functional>
 #include <string>
 #include <vector>
-#include <unordered_map>
 #include <sstream>
 
 #include "bool.hxx"
@@ -41,6 +40,7 @@
 #include "types_comparison_eq.hxx"
 
 #include "view_scilab/Adapters.hxx"
+#include "view_scilab/AdapterView.hxx"
 #include "controller_helpers.hxx"
 #include "utilities.hxx"
 #include "Controller.hxx"
@@ -74,9 +74,29 @@ public:
     static props_t fields;
 
     property(const std::wstring& prop, getter_t g, setter_t s) : original_index(fields.size()), name(prop), get(g), set(s) {};
+    property(const property& p) :
+        original_index(p.original_index),
+        name(p.name),
+        get(p.get),
+        set(p.set)
+    {};
     ~property() {};
+    property(property&& p) :
+        original_index(std::move(p.original_index)),
+        name(std::move(p.name)),
+        get(std::move(p.get)),
+        set(std::move(p.set))
+    {};
+    property<Adaptor>& operator= (property<Adaptor>&& p)
+    {
+        original_index = std::move(p.original_index);
+        name = std::move(p.name);
+        get = std::move(p.get);
+        set = std::move(p.set);
+        return *this;
+    };
 
-    size_t original_index;
+    int original_index;
     std::wstring name;
     getter_t get;
     setter_t set;
@@ -172,9 +192,10 @@ public:
     {
         if (adapter.getAdaptee() != nullptr)
         {
+            AdapterView update_partial_information;
             Controller controller;
 
-            std::unordered_map<BaseObject*, BaseObject*> mapped;
+            Controller::cloned_t mapped;
             BaseObject* clone = controller.cloneBaseObject(mapped, adapter.getAdaptee(), cloneChildren, true);
             m_adaptee = static_cast<Adaptee*>(clone);
         }
@@ -184,6 +205,8 @@ public:
     {
         if (m_adaptee != nullptr)
         {
+            AdapterView update_partial_information;
+
             Controller controller;
             controller.deleteObject(m_adaptee->id());
         }
@@ -204,7 +227,8 @@ public:
         typename property<Adaptor>::props_t_it found = property<Adaptor>::find(_sKey);
         if (found != property<Adaptor>::fields.end())
         {
-            return found->get(*static_cast<Adaptor*>(this), controller);
+            Adaptor& adapter = *static_cast<Adaptor*>(this);
+            return found->get(adapter, controller);
         }
         return nullptr;
     }
@@ -214,7 +238,8 @@ public:
         typename property<Adaptor>::props_t_it found = property<Adaptor>::find(_sKey);
         if (found != property<Adaptor>::fields.end())
         {
-            return found->set(*static_cast<Adaptor*>(this), v, controller);
+            Adaptor& adapter = *static_cast<Adaptor*>(this);
+            return found->set(adapter, v, controller);
         }
         return false;
     }
@@ -373,7 +398,7 @@ public:
         {
             types::InternalType* ith_prop1 = p.get(*static_cast<Adaptor*>(this), controller);
             types::InternalType* ith_prop2 = p.get(*static_cast<Adaptor*>(ut), controller);
-            ret->set(p.original_index, *ith_prop1 == *ith_prop2);
+            ret->set(p.original_index + 1, *ith_prop1 == *ith_prop2);
 
             // Getting a property allocates data, so free them
             ith_prop1->killMe();
@@ -417,8 +442,8 @@ public:
      * All following methods should be implemented by each template instance
      */
 
-    virtual std::wstring getTypeStr() const = 0;
-    virtual std::wstring getShortTypeStr() const = 0;
+    virtual std::wstring getTypeStr() const override = 0;
+    virtual std::wstring getShortTypeStr() const override = 0;
 
 private:
     virtual UserType* clone() override final