diff --git a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h index 2af1c3dad17..e2e3f5d668f 100644 --- a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h +++ b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include #include @@ -499,10 +501,18 @@ private: mutable bool sliver_cache_validity_; public: - std::size_t ts; + std::size_t time_stamp_; }; // end class Compact_mesh_cell_base_3 +namespace internal { +namespace Mesh_3 { + template < class GT, class MT, class Cb > + struct Has_timestamp< Compact_mesh_cell_base_3 > + : public CGAL::Tag_true + {}; +} // end namespace internal::Mesh_3 +} // end namespace internal template < class GT, class MT, class Cb > diff --git a/Mesh_3/include/CGAL/Mesh_3/Has_timestamp.h b/Mesh_3/include/CGAL/Mesh_3/Has_timestamp.h new file mode 100644 index 00000000000..eaef0ae56ce --- /dev/null +++ b/Mesh_3/include/CGAL/Mesh_3/Has_timestamp.h @@ -0,0 +1,43 @@ +// Copyright (c) 2009 INRIA Sophia-Antipolis (France). +// Copyright (c) 2014 GeometryFactory Sarl (France) +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// +// +// Author(s) : Jane Tournois + +#ifndef CGAL_MESH_3_HAS_TIMESTAMP_H +#define CGAL_MESH_3_HAS_TIMESTAMP_H + +#include +#include + +namespace CGAL { + +namespace internal { +namespace Mesh_3 { + + // to have Mesh_3 deterministic, + // a partial specialization of this class should be written next to + // every class that implements concepts MeshCellBase_3 or MeshVertexBase_3 + template + struct Has_timestamp : public CGAL::Tag_false + // when T does not have a partial specialization of Has_timestamp + {}; + +} // end namespace internal::Mesh_3 +} // end namespace internal +} // end namespace CGAL + +#endif // CGAL_MESH_3_HAS_TIMESTAMP_H diff --git a/Mesh_3/include/CGAL/Mesh_cell_base_3.h b/Mesh_3/include/CGAL/Mesh_cell_base_3.h index 283d1baf9eb..341fa1b42a0 100644 --- a/Mesh_3/include/CGAL/Mesh_cell_base_3.h +++ b/Mesh_3/include/CGAL/Mesh_cell_base_3.h @@ -33,6 +33,8 @@ #include #include #include +#include +#include namespace CGAL { @@ -169,8 +171,19 @@ private: Cell_handle next_intrusive_, previous_intrusive_; #endif +public: + std::size_t time_stamp_; + }; // end class Mesh_cell_base_3 +namespace internal { +namespace Mesh_3 { + template < class GT, class MT, class Cb > + struct Has_timestamp< Mesh_cell_base_3 > + : public CGAL::Tag_true + {}; +} // end namespace internal::Mesh_3 +} // end namespace internal template < class GT, class MT, class Cb > diff --git a/Mesh_3/include/CGAL/Mesh_vertex_base_3.h b/Mesh_3/include/CGAL/Mesh_vertex_base_3.h index 6765e9c4721..eaed5e9ccae 100644 --- a/Mesh_3/include/CGAL/Mesh_vertex_base_3.h +++ b/Mesh_3/include/CGAL/Mesh_vertex_base_3.h @@ -30,9 +30,10 @@ #define CGAL_COMPACT_MESH_VERTEX_BASE_3_H #include -#include #include #include +#include +#include namespace CGAL { @@ -160,7 +161,7 @@ public: } public: - std::size_t ts; + std::size_t time_stamp_; private: @@ -187,6 +188,10 @@ private: namespace internal { namespace Mesh_3 { + template < class GT, class MT, class Vb > + struct Has_timestamp< Mesh_vertex_base_3 > + : public CGAL::Tag_true + {}; } // end namespace internal::Mesh_3 } // end namespace internal diff --git a/STL_Extension/include/CGAL/Compact_container.h b/STL_Extension/include/CGAL/Compact_container.h index c9a17224afa..464d5b38a0a 100644 --- a/STL_Extension/include/CGAL/Compact_container.h +++ b/STL_Extension/include/CGAL/Compact_container.h @@ -30,6 +30,7 @@ #include #include +#include #include @@ -121,8 +122,8 @@ public: CGAL_time_stamper(const CGAL_time_stamper& ts) : time_stamp_(ts.time_stamp_) {} - void set_time_stamp(T* pt) { pt->ts = time_stamp_++; } - static std::size_t get(T* pt) { return pt->ts; } + void set_time_stamp(T* pt) { pt->time_stamp_ = time_stamp_++; } + static std::size_t get(T* pt) { return pt->time_stamp_; } void reset() { time_stamp_ = 0; } std::size_t time_stamp_; @@ -147,7 +148,8 @@ class Compact_container typedef typename Default::Get< Al, CGAL_ALLOCATOR(T) >::type Allocator; typedef TimeStamper_ Ts; - typedef typename boost::mpl::if_c< true,// CGAL::has_timestamp, + typedef typename boost::mpl::if_c< + CGAL::internal::Mesh_3::Has_timestamp::value, typename CGAL_time_stamper, typename CGAL_no_time_stamp >::type Time_stamper_; typedef typename Default::Get::type Time_stamper; diff --git a/Spatial_searching/include/CGAL/Kd_tree_node.h b/Spatial_searching/include/CGAL/Kd_tree_node.h index 561bda0c0d3..159bdf6a8bf 100644 --- a/Spatial_searching/include/CGAL/Kd_tree_node.h +++ b/Spatial_searching/include/CGAL/Kd_tree_node.h @@ -24,6 +24,8 @@ #include #include +#include + namespace CGAL { template @@ -61,9 +63,6 @@ namespace CGAL { // private variables for extended internal nodes FT low_val; FT high_val; - - public: - std::size_t ts; public: @@ -75,11 +74,11 @@ namespace CGAL { {} Kd_tree_node(Node_type t ) - : the_node_type(t) , ts(0) + : the_node_type(t) {} Kd_tree_node(unsigned int n_, Node_type t ) - : the_node_type(t), n(n_), ts(0) + : the_node_type(t), n(n_) {} // members for all nodes diff --git a/Triangulation_3/include/CGAL/Triangulation_ds_cell_base_3.h b/Triangulation_3/include/CGAL/Triangulation_ds_cell_base_3.h index dc63441d5d0..c6ccd94ce67 100644 --- a/Triangulation_3/include/CGAL/Triangulation_ds_cell_base_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_ds_cell_base_3.h @@ -26,6 +26,7 @@ #include #include #include +#include namespace CGAL { @@ -207,8 +208,6 @@ private: Cell_handle N[4]; Vertex_handle V[4]; TDS_data _tds_data; -public: - std::size_t ts; }; template < class TDS >