Xcos MVC: reference counter instead of shared_ptr 17/15917/6
authorClément DAVID <clement.david@scilab-enterprises.com>
Wed, 4 Feb 2015 10:48:31 +0000 (11:48 +0100)
committerClément DAVID <clement.david@scilab-enterprises.com>
Fri, 20 Feb 2015 14:41:20 +0000 (15:41 +0100)
commit7eb84925f0d87969d646cfb340f5eef5f967a100
treebeb32403751c13f403ba14512260c097b3622067
parentba9bc4c3c7d70b5f0a5f523954b6a8d213a44525
Xcos MVC: reference counter instead of shared_ptr

shared_ptr can not be used on the Java side, instead of using 2
reference counting scheme (for composition and for multi-view) the
previous shared_ptr usage has been moved to the reference counting.

The API just allow any view to referenceObject which increment the
deleteObject number of calls needed to free the object.

This commit also fix memory leaks by :

 * Allowing a cloneObject without deep copy of children.
 * Implementing DiagramAdapter cloning the right way (cloning children
   only once).
 * Re-using properties accessor on copy-constructors

Change-Id: I0c7d509bd7944c9044371ea2ae1b49900413071b
64 files changed:
scilab/modules/scicos/Makefile.am
scilab/modules/scicos/Makefile.in
scilab/modules/scicos/includes/Controller.hxx
scilab/modules/scicos/includes/Model.hxx
scilab/modules/scicos/includes/utilities.hxx
scilab/modules/scicos/sci_gateway/cpp/sci_scicos_new.cpp
scilab/modules/scicos/src/c/scicos.vcxproj
scilab/modules/scicos/src/c/scicos.vcxproj.filters
scilab/modules/scicos/src/cpp/Controller.cpp
scilab/modules/scicos/src/cpp/LoggerView.cpp
scilab/modules/scicos/src/cpp/LoggerView.hxx
scilab/modules/scicos/src/cpp/Model.cpp
scilab/modules/scicos/src/cpp/Model_getObjectProperties.cpp
scilab/modules/scicos/src/cpp/Model_setObjectProperties.cpp
scilab/modules/scicos/src/cpp/model/Annotation.hxx
scilab/modules/scicos/src/cpp/model/Link.hxx
scilab/modules/scicos/src/cpp/view_scilab/BaseAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/BlockAdapter.cpp
scilab/modules/scicos/src/cpp/view_scilab/BlockAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/CprAdapter.cpp
scilab/modules/scicos/src/cpp/view_scilab/CprAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/DiagramAdapter.cpp
scilab/modules/scicos/src/cpp/view_scilab/DiagramAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/GraphicsAdapter.cpp
scilab/modules/scicos/src/cpp/view_scilab/GraphicsAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/LinkAdapter.cpp
scilab/modules/scicos/src/cpp/view_scilab/LinkAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/ModelAdapter.cpp
scilab/modules/scicos/src/cpp/view_scilab/ModelAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/ParamsAdapter.cpp
scilab/modules/scicos/src/cpp/view_scilab/ParamsAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/ScsAdapter.cpp
scilab/modules/scicos/src/cpp/view_scilab/ScsAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/StateAdapter.cpp
scilab/modules/scicos/src/cpp/view_scilab/StateAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/TextAdapter.cpp
scilab/modules/scicos/src/cpp/view_scilab/TextAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/ports_management.hxx
scilab/modules/scicos/src/cpp/view_scilab/recursive_cloning.cpp [deleted file]
scilab/modules/scicos/src/cpp/view_scilab/recursive_cloning.hxx [deleted file]
scilab/modules/scicos/tests/unit_tests/model/Block.dia.ref
scilab/modules/scicos/tests/unit_tests/model/Block_copy_list.dia.ref
scilab/modules/scicos/tests/unit_tests/model/Consecutive_init.dia.ref
scilab/modules/scicos/tests/unit_tests/model/Deep_cloning.dia.ref
scilab/modules/scicos/tests/unit_tests/model/Delete_objects.dia.ref
scilab/modules/scicos/tests/unit_tests/model/Diagram.dia.ref
scilab/modules/scicos/tests/unit_tests/model/SuperBlock.dia.ref
scilab/modules/scicos/tests/unit_tests/model/SuperBlock_in_SuperBlock.dia.ref
scilab/modules/scicos/tests/unit_tests/model/link_preservation.dia.ref
scilab/modules/scicos/tests/unit_tests/model/simple_delete.dia.ref
scilab/modules/xcos/src/java/org/scilab/modules/xcos/Controller.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/JavaController.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/JavaControllerJNI.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/Kind.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/ObjectProperties.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/UpdateStatus.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/VectorOfBool.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/VectorOfDouble.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/VectorOfInt.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/VectorOfScicosID.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/VectorOfString.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/View.java
scilab/modules/xcos/src/jni/JavaController_wrap.cxx
scilab/modules/xcos/src/jni/JavaController_wrap.h