branch: upgrade_to_cpp14_consolidated commit b709d375233d7b99c270819df6b0bd7b6feaa3f6 Author: aa <a...@plaxis.com> Date: Thu Apr 4 16:00:17 2019 +0200
replacing boost with STL or standard language features whenever possible --- src/getfem/bgeot_config.h | 7 ------- src/getfem/bgeot_kdtree.h | 6 +++++- src/getfem/dal_static_stored_objects.h | 11 ++--------- src/getfem/getfem_context.h | 10 ++-------- src/getfem/getfem_mesh_fem_level_set.h | 5 ++++- src/getfem/getfem_partial_mesh_fem.h | 5 ++++- 6 files changed, 17 insertions(+), 27 deletions(-) diff --git a/src/getfem/bgeot_config.h b/src/getfem/bgeot_config.h index 66a367b..ad951fa 100644 --- a/src/getfem/bgeot_config.h +++ b/src/getfem/bgeot_config.h @@ -50,13 +50,6 @@ #include "gmm/gmm_kernel.h" #include "gmm/gmm_dense_lu.h" -#ifdef GETFEM_HAVE_BOOST -# include <boost/version.hpp> -# include <boost/noncopyable.hpp> -#else -# include <getfem_boost/noncopyable.hpp> -#endif - #ifdef GETFEM_HAVE_QDLIB // # define NO_INLINE # ifdef GETFEM_QDLIB_USE_QUAD diff --git a/src/getfem/bgeot_kdtree.h b/src/getfem/bgeot_kdtree.h index 81c00e9..e347e5a 100644 --- a/src/getfem/bgeot_kdtree.h +++ b/src/getfem/bgeot_kdtree.h @@ -100,12 +100,16 @@ namespace bgeot { } @endcode */ - class kdtree : public boost::noncopyable { + class kdtree { dim_type N; /* dimension of points */ std::unique_ptr<kdtree_elt_base> tree; kdtree_tab_type pts; public: kdtree() : N(0) {} + + kdtree(const kdtree&) = delete; + kdtree &operator = (const kdtree&) = delete; + /// reset the tree, remove all points void clear() { clear_tree(); pts = kdtree_tab_type(); N = 0; } void reserve(size_type n) { pts.reserve(n); } diff --git a/src/getfem/dal_static_stored_objects.h b/src/getfem/dal_static_stored_objects.h index be8ca7e..16814b1 100644 --- a/src/getfem/dal_static_stored_objects.h +++ b/src/getfem/dal_static_stored_objects.h @@ -77,14 +77,7 @@ std::shared_ptr are used. #include "getfem/getfem_arch_config.h" -#ifdef GETFEM_HAS_OPENMP - #include <boost/atomic.hpp> - typedef boost::atomic_bool atomic_bool; - typedef boost::atomic<int> atomic_int; -#else - typedef int atomic_int; - typedef bool atomic_bool; -#endif +#include <atomic> #define DAL_STORED_OBJECT_DEBUG 0 @@ -298,7 +291,7 @@ namespace dal { /** Pointer to an object with the dependencies */ struct enr_static_stored_object { pstatic_stored_object p; - atomic_bool valid; + std::atomic_bool valid; const permanence perm; std::set<pstatic_stored_object> dependent_object; std::set<pstatic_stored_object> dependencies; diff --git a/src/getfem/getfem_context.h b/src/getfem/getfem_context.h index e24f4e5..e82017b 100644 --- a/src/getfem/getfem_context.h +++ b/src/getfem/getfem_context.h @@ -41,13 +41,7 @@ #include "getfem_omp.h" #include <list> -#ifdef GETFEM_HAS_OPENMP - #include <boost/atomic.hpp> - typedef boost::atomic_bool atomic_bool; -#else - typedef bool atomic_bool; -#endif - +#include <atomic> namespace getfem { /**Deal with interdependencies of objects. @@ -89,7 +83,7 @@ namespace getfem { protected : enum context_state { CONTEXT_NORMAL, CONTEXT_CHANGED, CONTEXT_INVALID }; mutable context_state state; - mutable atomic_bool touched; + mutable std::atomic_bool touched; mutable std::vector<const context_dependencies *> dependencies; mutable std::vector<const context_dependencies *> dependent; typedef std::vector<const context_dependencies *>::iterator iterator_list; diff --git a/src/getfem/getfem_mesh_fem_level_set.h b/src/getfem/getfem_mesh_fem_level_set.h index 81cb4b8..e0e853c 100644 --- a/src/getfem/getfem_mesh_fem_level_set.h +++ b/src/getfem/getfem_mesh_fem_level_set.h @@ -45,7 +45,7 @@ namespace getfem { - class mesh_fem_level_set : public mesh_fem, public boost::noncopyable { + class mesh_fem_level_set : public mesh_fem { protected : const mesh_level_set &mls; const mesh_fem &mf; @@ -72,6 +72,9 @@ namespace getfem { mesh_fem_level_set(const mesh_level_set &me, const mesh_fem &mef); + mesh_fem_level_set(const mesh_fem_level_set&) = delete; + mesh_fem_level_set& operator = (const mesh_fem_level_set&) = delete; + ~mesh_fem_level_set() { clear_build_methods(); } }; diff --git a/src/getfem/getfem_partial_mesh_fem.h b/src/getfem/getfem_partial_mesh_fem.h index 3ce3411..68230b8 100644 --- a/src/getfem/getfem_partial_mesh_fem.h +++ b/src/getfem/getfem_partial_mesh_fem.h @@ -52,7 +52,7 @@ namespace getfem { a subclass of mesh_fem which allows to eliminate a number of dof of the original mesh_fem. */ - class partial_mesh_fem : public mesh_fem, public boost::noncopyable { + class partial_mesh_fem : public mesh_fem { protected : const mesh_fem &mf; mutable bool is_adapted; @@ -152,6 +152,9 @@ namespace getfem { partial_mesh_fem(const mesh_fem &mef); partial_mesh_fem(const mesh_fem *mef); + partial_mesh_fem(const partial_mesh_fem&) = delete; + partial_mesh_fem& operator = (const partial_mesh_fem&) = delete; + }; typedef std::shared_ptr<partial_mesh_fem> ppartial_mesh_fem;