Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73029 - in sandbox-branches/geometry/index/boost/geometry/extensions/index: . rtree rtree/rstar rtree/visitors
From: adam.wulkiewicz_at_[hidden]
Date: 2011-07-12 21:57:31


Author: awulkiew
Date: 2011-07-12 21:57:30 EDT (Tue, 12 Jul 2011)
New Revision: 73029
URL: http://svn.boost.org/trac/boost/changeset/73029

Log:
visitors are now explicitly nonassignable. rtree is set as noncopyable since copying isn't implemented.
Added:
   sandbox-branches/geometry/index/boost/geometry/extensions/index/nonassignable.hpp (contents, props changed)
Text files modified:
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rstar/insert.hpp | 1 +
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rstar/redistribute_elements.hpp | 5 ++---
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rtree.hpp | 4 +++-
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp | 4 +++-
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/are_levels_ok.hpp | 4 +++-
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/find.hpp | 4 +++-
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/insert.hpp | 4 +++-
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/remove.hpp | 4 +++-
   8 files changed, 21 insertions(+), 9 deletions(-)

Added: sandbox-branches/geometry/index/boost/geometry/extensions/index/nonassignable.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/nonassignable.hpp 2011-07-12 21:57:30 EDT (Tue, 12 Jul 2011)
@@ -0,0 +1,22 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Boost.Index - nonassignable
+//
+// Copyright 2011 Adam Wulkiewicz.
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_NONASSIGNABLE_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_INDEX_NONASSIGNABLE_HPP
+
+namespace boost { namespace geometry { namespace index {
+
+class nonassignable
+{
+ nonassignable & operator=(nonassignable const&);
+};
+
+}}} // namespace boost::geometry::index
+
+#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_NONASSIGNABLE_HPP

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rstar/insert.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rstar/insert.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rstar/insert.hpp 2011-07-12 21:57:30 EDT (Tue, 12 Jul 2011)
@@ -352,6 +352,7 @@
 template <typename Element, typename Value, typename Options, typename Translator, typename Box>
 class insert<Element, Value, Options, Translator, Box, reinsert_tag>
         : public rtree::visitor<Value, typename Options::parameters_type, Box, typename Options::node_tag, false>::type
+ , index::nonassignable
 {
 private:
         typedef typename rtree::node<Value, typename Options::parameters_type, Box, typename Options::node_tag>::type node;

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rstar/redistribute_elements.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rstar/redistribute_elements.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rstar/redistribute_elements.hpp 2011-07-12 21:57:30 EDT (Tue, 12 Jul 2011)
@@ -10,14 +10,12 @@
 #ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RSTAR_REDISTRIBUTE_ELEMENTS_HPP
 #define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_RSTAR_REDISTRIBUTE_ELEMENTS_HPP
 
-#include <algorithm>
+#include <boost/geometry/extensions/index/nonassignable.hpp>
 
 #include <boost/geometry/extensions/index/algorithms/intersection_content.hpp>
 #include <boost/geometry/extensions/index/algorithms/union_content.hpp>
 #include <boost/geometry/extensions/index/algorithms/margin.hpp>
 
-#include <boost/geometry/algorithms/intersection.hpp>
-
 #include <boost/geometry/extensions/index/rtree/node/node.hpp>
 #include <boost/geometry/extensions/index/rtree/visitors/insert.hpp>
 #include <boost/geometry/extensions/index/rtree/visitors/is_leaf.hpp>
@@ -32,6 +30,7 @@
 
 template <typename Element, typename Translator, size_t Corner, size_t AxisIndex>
 class element_axis_corner_less
+ : index::nonassignable
 {
 public:
         element_axis_corner_less(Translator const& tr)

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rtree.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rtree.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rtree.hpp 2011-07-12 21:57:30 EDT (Tue, 12 Jul 2011)
@@ -17,6 +17,7 @@
 #include <boost/geometry/geometry.hpp>
 
 #include <boost/geometry/extensions/index/assert.hpp>
+#include <boost/geometry/extensions/index/nonassignable.hpp>
 
 #include <boost/geometry/extensions/index/translator/translator.hpp>
 
@@ -36,7 +37,7 @@
 
 namespace boost { namespace geometry { namespace index {
 
-// TODO: awulkiew - min and max elems as template parameters?
+// TODO copying
 
 template <
     typename Value,
@@ -44,6 +45,7 @@
         typename Translator = translator::def<Value>
>
 class rtree
+ : public boost::noncopyable
 {
 public:
     typedef Value value_type;

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/are_boxes_ok.hpp 2011-07-12 21:57:30 EDT (Tue, 12 Jul 2011)
@@ -18,7 +18,9 @@
 namespace detail { namespace rtree { namespace visitors {
 
 template <typename Value, typename Options, typename Translator, typename Box>
-class are_boxes_ok : public rtree::visitor<Value, typename Options::parameters_type, Box, typename Options::node_tag, true>::type
+class are_boxes_ok
+ : public rtree::visitor<Value, typename Options::parameters_type, Box, typename Options::node_tag, true>::type
+ , index::nonassignable
 {
     typedef typename rtree::internal_node<Value, typename Options::parameters_type, Box, typename Options::node_tag>::type internal_node;
     typedef typename rtree::leaf<Value, typename Options::parameters_type, Box, typename Options::node_tag>::type leaf;

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/are_levels_ok.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/are_levels_ok.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/are_levels_ok.hpp 2011-07-12 21:57:30 EDT (Tue, 12 Jul 2011)
@@ -17,7 +17,9 @@
 namespace detail { namespace rtree { namespace visitors {
 
 template <typename Value, typename Options, typename Translator, typename Box>
-class are_levels_ok : public rtree::visitor<Value, typename Options::parameters_type, Box, typename Options::node_tag, true>::type
+class are_levels_ok
+ : public rtree::visitor<Value, typename Options::parameters_type, Box, typename Options::node_tag, true>::type
+ , index::nonassignable
 {
     typedef typename rtree::internal_node<Value, typename Options::parameters_type, Box, typename Options::node_tag>::type internal_node;
     typedef typename rtree::leaf<Value, typename Options::parameters_type, Box, typename Options::node_tag>::type leaf;

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/find.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/find.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/find.hpp 2011-07-12 21:57:30 EDT (Tue, 12 Jul 2011)
@@ -141,7 +141,9 @@
 // rtree spatial query visitor
 
 template <typename Value, typename Options, typename Translator, typename Box, typename Geometry, typename OutIter>
-struct find : public rtree::visitor<Value, typename Options::parameters_type, Box, typename Options::node_tag, true>::type
+struct find
+ : public rtree::visitor<Value, typename Options::parameters_type, Box, typename Options::node_tag, true>::type
+ , index::nonassignable
 {
     typedef typename rtree::node<Value, typename Options::parameters_type, Box, typename Options::node_tag>::type node;
     typedef typename rtree::internal_node<Value, typename Options::parameters_type, Box, typename Options::node_tag>::type internal_node;

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/insert.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/insert.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/insert.hpp 2011-07-12 21:57:30 EDT (Tue, 12 Jul 2011)
@@ -83,7 +83,9 @@
 
 // Default insert visitor
 template <typename Element, typename Value, typename Options, typename Translator, typename Box>
-class insert : public rtree::visitor<Value, typename Options::parameters_type, Box, typename Options::node_tag, false>::type
+class insert
+ : public rtree::visitor<Value, typename Options::parameters_type, Box, typename Options::node_tag, false>::type
+ , index::nonassignable
 {
 protected:
     typedef typename rtree::node<Value, typename Options::parameters_type, Box, typename Options::node_tag>::type node;

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/remove.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/remove.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/remove.hpp 2011-07-12 21:57:30 EDT (Tue, 12 Jul 2011)
@@ -22,7 +22,9 @@
 
 // Default remove algorithm
 template <typename Value, typename Options, typename Translator, typename Box>
-class remove : public rtree::visitor<Value, typename Options::parameters_type, Box, typename Options::node_tag, false>::type
+class remove
+ : public rtree::visitor<Value, typename Options::parameters_type, Box, typename Options::node_tag, false>::type
+ , index::nonassignable
 {
     typedef typename rtree::node<Value, typename Options::parameters_type, Box, typename Options::node_tag>::type node;
     typedef typename rtree::internal_node<Value, typename Options::parameters_type, Box, typename Options::node_tag>::type internal_node;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk