visitors are now explicitly nonassignable. rtree is set as noncopyable since copying isn't implemented.

[SVN r73029]
This commit is contained in:
Adam Wulkiewicz
2011-07-13 01:57:30 +00:00
parent e7d84e1bfa
commit 5586fc85bf
9 changed files with 43 additions and 9 deletions

View File

@@ -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

View File

@@ -352,6 +352,7 @@ struct level_insert<0, Value, Value, Options, Translator, Box>
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;

View File

@@ -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 @@ namespace rstar {
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)

View File

@@ -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 @@ template <
typename Translator = translator::def<Value>
>
class rtree
: public boost::noncopyable
{
public:
typedef Value value_type;

View File

@@ -18,7 +18,9 @@ namespace boost { namespace geometry { namespace index {
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;

View File

@@ -17,7 +17,9 @@ namespace boost { namespace geometry { namespace index {
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;

View File

@@ -141,7 +141,9 @@ namespace detail { namespace rtree { namespace visitors {
// 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;

View File

@@ -83,7 +83,9 @@ struct redistribute_elements;
// 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;

View File

@@ -22,7 +22,9 @@ namespace detail { namespace rtree { namespace visitors {
// 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;