update boost on linux
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// boxes union/intersection area/volume
|
||||
//
|
||||
// Copyright (c) 2011-2016 Adam Wulkiewicz, Lodz, Poland.
|
||||
// Copyright (c) 2011-2018 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -11,8 +11,9 @@
|
||||
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_INTERSECTION_CONTENT_HPP
|
||||
#define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_INTERSECTION_CONTENT_HPP
|
||||
|
||||
#include <boost/geometry/algorithms/intersection.hpp>
|
||||
#include <boost/geometry/strategies/intersection_strategies.hpp>
|
||||
#include <boost/geometry/algorithms/detail/disjoint/box_box.hpp>
|
||||
#include <boost/geometry/algorithms/detail/overlay/intersection_box_box.hpp>
|
||||
|
||||
#include <boost/geometry/index/detail/algorithms/content.hpp>
|
||||
|
||||
namespace boost { namespace geometry { namespace index { namespace detail {
|
||||
@@ -23,11 +24,24 @@ namespace boost { namespace geometry { namespace index { namespace detail {
|
||||
template <typename Box>
|
||||
inline typename default_content_result<Box>::type intersection_content(Box const& box1, Box const& box2)
|
||||
{
|
||||
if ( geometry::intersects(box1, box2) )
|
||||
typedef typename strategy::disjoint::services::default_strategy
|
||||
<
|
||||
Box, Box
|
||||
>::type strategy_type;
|
||||
|
||||
bool const intersects = ! geometry::detail::disjoint::disjoint_box_box(box1, box2, strategy_type());
|
||||
|
||||
if ( intersects )
|
||||
{
|
||||
Box box_intersection;
|
||||
if ( geometry::intersection(box1, box2, box_intersection) )
|
||||
return detail::content(box_intersection);
|
||||
bool const ok = geometry::detail::intersection::intersection_box_box
|
||||
<
|
||||
0, geometry::dimension<Box>::value
|
||||
>::apply(box1, box2, 0, box_intersection, 0);
|
||||
if ( ok )
|
||||
{
|
||||
return index::detail::content(box_intersection);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// n-dimensional box-linestring intersection
|
||||
//
|
||||
// Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
// Copyright (c) 2011-2017 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -11,8 +11,12 @@
|
||||
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_PATH_INTERSECTION_HPP
|
||||
#define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_PATH_INTERSECTION_HPP
|
||||
|
||||
|
||||
#include <boost/geometry/index/detail/algorithms/segment_intersection.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/default_length_result.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry { namespace index { namespace detail {
|
||||
|
||||
namespace dispatch {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost.Geometry Index
|
||||
//
|
||||
// Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland.
|
||||
// Copyright (c) 2011-2019 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -10,7 +10,8 @@
|
||||
#include <boost/mpl/aux_/has_type.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/and.hpp>
|
||||
//#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_META_HPP
|
||||
#define BOOST_GEOMETRY_INDEX_DETAIL_META_HPP
|
||||
@@ -37,6 +38,68 @@ struct is_range
|
||||
// : is_range_of_convertible_values_impl<T, V, is_range<T>::value>
|
||||
//{};
|
||||
|
||||
// Implemented this way in order to prevent instantiation of all type traits at
|
||||
// once because some of them are causing problems with gcc 4.6 namely
|
||||
// is_convertible<bg::model::segment<>, std::pair<bg::model::segment<>, T> >
|
||||
// because segment<> is derived from pair<> and pair<> has copy ctor taking
|
||||
// other pair<> of any types the compiler tries to instantiate ctor of
|
||||
// pair<segment, T> taking pair<point, point> which results in instantiation of
|
||||
// segment's ctor taking a point which results in compilation error.
|
||||
// This is probably compiler's bug.
|
||||
template <typename T, typename Value, typename Indexable, typename ResultType, int Ver>
|
||||
struct convertible_type_impl
|
||||
{
|
||||
typedef ResultType type;
|
||||
};
|
||||
|
||||
template <typename T, typename Value, typename Indexable>
|
||||
struct convertible_type_impl<T, Value, Indexable, void, 0>
|
||||
{
|
||||
typedef typename boost::mpl::if_c
|
||||
<
|
||||
boost::is_convertible<T, Indexable>::value,
|
||||
Indexable,
|
||||
void
|
||||
>::type result_type;
|
||||
|
||||
typedef typename convertible_type_impl
|
||||
<
|
||||
T, Value, Indexable, result_type, 1
|
||||
>::type type;
|
||||
};
|
||||
|
||||
template <typename T, typename Value, typename Indexable>
|
||||
struct convertible_type_impl<T, Value, Indexable, void, 1>
|
||||
{
|
||||
typedef typename boost::mpl::if_c
|
||||
<
|
||||
boost::is_convertible<T, Value>::value,
|
||||
Value,
|
||||
void
|
||||
>::type type;
|
||||
};
|
||||
|
||||
template <typename T, typename Value, typename Indexable>
|
||||
struct convertible_type
|
||||
{
|
||||
typedef typename boost::mpl::if_c
|
||||
<
|
||||
boost::is_same<T, Value>::value,
|
||||
Value,
|
||||
typename boost::mpl::if_c
|
||||
<
|
||||
boost::is_same<T, Indexable>::value,
|
||||
Indexable,
|
||||
void
|
||||
>::type
|
||||
>::type result_type;
|
||||
|
||||
typedef typename convertible_type_impl
|
||||
<
|
||||
T, Value, Indexable, result_type, 0
|
||||
>::type type;
|
||||
};
|
||||
|
||||
}}}} // namespace boost::geometry::index::detail
|
||||
|
||||
#endif // BOOST_GEOMETRY_INDEX_DETAIL_META_HPP
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_LINEAR_REDISTRIBUTE_ELEMENTS_HPP
|
||||
#define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_LINEAR_REDISTRIBUTE_ELEMENTS_HPP
|
||||
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
#include <boost/type_traits/is_unsigned.hpp>
|
||||
|
||||
#include <boost/geometry/index/detail/algorithms/content.hpp>
|
||||
@@ -156,7 +157,7 @@ struct find_greatest_normalized_separation
|
||||
seed1 = highest_low_index;
|
||||
seed2 = lowest_high_index;
|
||||
|
||||
::boost::ignore_unused_variable_warning(parameters);
|
||||
::boost::ignore_unused(parameters);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -211,7 +212,7 @@ struct find_greatest_normalized_separation<Elements, Parameters, Translator, poi
|
||||
if ( lowest_index == highest_index )
|
||||
seed2 = (lowest_index + 1) % elements_count; // % is just in case since if this is true lowest_index is 0
|
||||
|
||||
::boost::ignore_unused_variable_warning(parameters);
|
||||
::boost::ignore_unused(parameters);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// R-tree scoped deallocator
|
||||
//
|
||||
// Copyright (c) 2011-2015 Adam Wulkiewicz, Lodz, Poland.
|
||||
// Copyright (c) 2011-2018 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -18,10 +18,13 @@ namespace detail { namespace rtree {
|
||||
template <typename Alloc>
|
||||
class scoped_deallocator
|
||||
{
|
||||
typedef boost::container::allocator_traits<Alloc> alloc_traits;
|
||||
|
||||
scoped_deallocator(scoped_deallocator const&);
|
||||
scoped_deallocator & operator=(scoped_deallocator const&);
|
||||
public:
|
||||
typedef typename Alloc::pointer pointer;
|
||||
typedef typename alloc_traits::pointer pointer;
|
||||
|
||||
inline scoped_deallocator(pointer p, Alloc & a)
|
||||
: m_ptr(p), m_alloc(a)
|
||||
{}
|
||||
@@ -29,7 +32,7 @@ public:
|
||||
{
|
||||
if ( m_ptr )
|
||||
{
|
||||
boost::container::allocator_traits<Alloc>::deallocate(m_alloc, m_ptr, 1);
|
||||
alloc_traits::deallocate(m_alloc, m_ptr, 1);
|
||||
}
|
||||
}
|
||||
inline void release()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// R-tree nodes based on Boost.Variant, storing dynamic-size containers
|
||||
//
|
||||
// Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
// Copyright (c) 2011-2018 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -11,6 +11,8 @@
|
||||
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_NODE_VARIANT_DYNAMIC_HPP
|
||||
#define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_NODE_VARIANT_DYNAMIC_HPP
|
||||
|
||||
#include <boost/core/pointer_traits.hpp>
|
||||
|
||||
namespace boost { namespace geometry { namespace index {
|
||||
|
||||
namespace detail { namespace rtree {
|
||||
@@ -20,18 +22,17 @@ namespace detail { namespace rtree {
|
||||
template <typename Value, typename Parameters, typename Box, typename Allocators, typename Tag>
|
||||
struct variant_internal_node
|
||||
{
|
||||
typedef boost::container::vector
|
||||
typedef rtree::ptr_pair<Box, typename Allocators::node_pointer> element_type;
|
||||
typedef typename boost::container::allocator_traits
|
||||
<
|
||||
rtree::ptr_pair<Box, typename Allocators::node_pointer>,
|
||||
typename Allocators::node_allocator_type::template rebind
|
||||
<
|
||||
rtree::ptr_pair<Box, typename Allocators::node_pointer>
|
||||
>::other
|
||||
> elements_type;
|
||||
typename Allocators::node_allocator_type
|
||||
>::template rebind_alloc<element_type> allocator_type;
|
||||
|
||||
typedef boost::container::vector<element_type, allocator_type> elements_type;
|
||||
|
||||
template <typename Al>
|
||||
inline variant_internal_node(Al const& al)
|
||||
: elements(al)
|
||||
: elements(allocator_type(al))
|
||||
{}
|
||||
|
||||
elements_type elements;
|
||||
@@ -40,18 +41,16 @@ struct variant_internal_node
|
||||
template <typename Value, typename Parameters, typename Box, typename Allocators, typename Tag>
|
||||
struct variant_leaf
|
||||
{
|
||||
typedef boost::container::vector
|
||||
typedef typename boost::container::allocator_traits
|
||||
<
|
||||
Value,
|
||||
typename Allocators::node_allocator_type::template rebind
|
||||
<
|
||||
Value
|
||||
>::other
|
||||
> elements_type;
|
||||
typename Allocators::node_allocator_type
|
||||
>::template rebind_alloc<Value> allocator_type;
|
||||
|
||||
template <typename Al>
|
||||
typedef boost::container::vector<Value, allocator_type> elements_type;
|
||||
|
||||
template <typename Al>
|
||||
inline variant_leaf(Al const& al)
|
||||
: elements(al)
|
||||
: elements(allocator_type(al))
|
||||
{}
|
||||
|
||||
elements_type elements;
|
||||
@@ -90,38 +89,59 @@ struct visitor<Value, Parameters, Box, Allocators, node_variant_dynamic_tag, IsV
|
||||
|
||||
// allocators
|
||||
|
||||
template <typename Allocator, typename Value, typename Parameters, typename Box, typename Tag>
|
||||
struct node_alloc
|
||||
{
|
||||
typedef typename node
|
||||
<
|
||||
Value, Parameters, Box,
|
||||
allocators<Allocator, Value, Parameters, Box, Tag>,
|
||||
Tag
|
||||
>::type node_type;
|
||||
|
||||
typedef typename boost::container::allocator_traits
|
||||
<
|
||||
Allocator
|
||||
>::template rebind_alloc<node_type> type;
|
||||
|
||||
typedef boost::container::allocator_traits<type> traits;
|
||||
};
|
||||
|
||||
|
||||
template <typename Allocator, typename Value, typename Parameters, typename Box>
|
||||
class allocators<Allocator, Value, Parameters, Box, node_variant_dynamic_tag>
|
||||
: public Allocator::template rebind<
|
||||
typename node<
|
||||
Value, Parameters, Box,
|
||||
allocators<Allocator, Value, Parameters, Box, node_variant_dynamic_tag>,
|
||||
node_variant_dynamic_tag
|
||||
: public detail::rtree::node_alloc
|
||||
<
|
||||
Allocator, Value, Parameters, Box, node_variant_dynamic_tag
|
||||
>::type
|
||||
>::other
|
||||
{
|
||||
typedef typename Allocator::template rebind<
|
||||
Value
|
||||
>::other value_allocator_type;
|
||||
typedef detail::rtree::node_alloc
|
||||
<
|
||||
Allocator, Value, Parameters, Box, node_variant_dynamic_tag
|
||||
> node_alloc;
|
||||
|
||||
public:
|
||||
typedef typename node_alloc::type node_allocator_type;
|
||||
typedef typename node_alloc::traits::pointer node_pointer;
|
||||
|
||||
private:
|
||||
typedef typename boost::container::allocator_traits
|
||||
<
|
||||
node_allocator_type // node_allocator_type for consistency with variant_leaf
|
||||
>::template rebind_alloc<Value> value_allocator_type;
|
||||
typedef boost::container::allocator_traits<value_allocator_type> value_allocator_traits;
|
||||
|
||||
|
||||
public:
|
||||
typedef Allocator allocator_type;
|
||||
|
||||
typedef Value value_type;
|
||||
typedef typename value_allocator_type::reference reference;
|
||||
typedef typename value_allocator_type::const_reference const_reference;
|
||||
typedef typename value_allocator_type::size_type size_type;
|
||||
typedef typename value_allocator_type::difference_type difference_type;
|
||||
typedef typename value_allocator_type::pointer pointer;
|
||||
typedef typename value_allocator_type::const_pointer const_pointer;
|
||||
|
||||
typedef typename Allocator::template rebind<
|
||||
typename node<Value, Parameters, Box, allocators, node_variant_dynamic_tag>::type
|
||||
>::other::pointer node_pointer;
|
||||
|
||||
typedef typename Allocator::template rebind<
|
||||
typename node<Value, Parameters, Box, allocators, node_variant_dynamic_tag>::type
|
||||
>::other node_allocator_type;
|
||||
typedef typename value_allocator_traits::reference reference;
|
||||
typedef typename value_allocator_traits::const_reference const_reference;
|
||||
typedef typename value_allocator_traits::size_type size_type;
|
||||
typedef typename value_allocator_traits::difference_type difference_type;
|
||||
typedef typename value_allocator_traits::pointer pointer;
|
||||
typedef typename value_allocator_traits::const_pointer const_pointer;
|
||||
|
||||
inline allocators()
|
||||
: node_allocator_type()
|
||||
@@ -183,7 +203,7 @@ struct create_variant_node
|
||||
|
||||
scoped_deallocator<AllocNode> deallocator(p, alloc_node);
|
||||
|
||||
Al::construct(alloc_node, boost::addressof(*p), Node(alloc_node)); // implicit cast to Variant
|
||||
Al::construct(alloc_node, boost::to_address(p), Node(alloc_node)); // implicit cast to Variant
|
||||
|
||||
deallocator.release();
|
||||
return p;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// R-tree nodes based on Boost.Variant, storing static-size containers
|
||||
//
|
||||
// Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
// Copyright (c) 2011-2018 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -80,36 +80,37 @@ struct visitor<Value, Parameters, Box, Allocators, node_variant_static_tag, IsVi
|
||||
|
||||
template <typename Allocator, typename Value, typename Parameters, typename Box>
|
||||
class allocators<Allocator, Value, Parameters, Box, node_variant_static_tag>
|
||||
: public Allocator::template rebind<
|
||||
typename node<
|
||||
Value, Parameters, Box,
|
||||
allocators<Allocator, Value, Parameters, Box, node_variant_static_tag>,
|
||||
node_variant_static_tag
|
||||
: public detail::rtree::node_alloc
|
||||
<
|
||||
Allocator, Value, Parameters, Box, node_variant_static_tag
|
||||
>::type
|
||||
>::other
|
||||
{
|
||||
typedef typename Allocator::template rebind<
|
||||
Value
|
||||
>::other value_allocator_type;
|
||||
typedef detail::rtree::node_alloc
|
||||
<
|
||||
Allocator, Value, Parameters, Box, node_variant_static_tag
|
||||
> node_alloc;
|
||||
|
||||
public:
|
||||
typedef typename node_alloc::type node_allocator_type;
|
||||
typedef typename node_alloc::traits::pointer node_pointer;
|
||||
|
||||
private:
|
||||
typedef typename boost::container::allocator_traits
|
||||
<
|
||||
node_allocator_type
|
||||
>::template rebind_alloc<Value> value_allocator_type;
|
||||
typedef boost::container::allocator_traits<value_allocator_type> value_allocator_traits;
|
||||
|
||||
public:
|
||||
typedef Allocator allocator_type;
|
||||
|
||||
typedef Value value_type;
|
||||
typedef value_type & reference;
|
||||
typedef const value_type & const_reference;
|
||||
typedef typename value_allocator_type::size_type size_type;
|
||||
typedef typename value_allocator_type::difference_type difference_type;
|
||||
typedef typename value_allocator_type::pointer pointer;
|
||||
typedef typename value_allocator_type::const_pointer const_pointer;
|
||||
|
||||
typedef typename Allocator::template rebind<
|
||||
typename node<Value, Parameters, Box, allocators, node_variant_static_tag>::type
|
||||
>::other::pointer node_pointer;
|
||||
|
||||
typedef typename Allocator::template rebind<
|
||||
typename node<Value, Parameters, Box, allocators, node_variant_static_tag>::type
|
||||
>::other node_allocator_type;
|
||||
typedef typename value_allocator_traits::reference reference;
|
||||
typedef typename value_allocator_traits::const_reference const_reference;
|
||||
typedef typename value_allocator_traits::size_type size_type;
|
||||
typedef typename value_allocator_traits::difference_type difference_type;
|
||||
typedef typename value_allocator_traits::pointer pointer;
|
||||
typedef typename value_allocator_traits::const_pointer const_pointer;
|
||||
|
||||
inline allocators()
|
||||
: node_allocator_type()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// R-tree nodes based on static conversion, storing dynamic-size containers
|
||||
//
|
||||
// Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
// Copyright (c) 2011-2018 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -19,18 +19,17 @@ template <typename Value, typename Parameters, typename Box, typename Allocators
|
||||
struct weak_internal_node
|
||||
: public weak_node<Value, Parameters, Box, Allocators, Tag>
|
||||
{
|
||||
typedef boost::container::vector
|
||||
typedef rtree::ptr_pair<Box, typename Allocators::node_pointer> element_type;
|
||||
typedef typename boost::container::allocator_traits
|
||||
<
|
||||
rtree::ptr_pair<Box, typename Allocators::node_pointer>,
|
||||
typename Allocators::internal_node_allocator_type::template rebind
|
||||
<
|
||||
rtree::ptr_pair<Box, typename Allocators::node_pointer>
|
||||
>::other
|
||||
> elements_type;
|
||||
typename Allocators::internal_node_allocator_type
|
||||
>::template rebind_alloc<element_type> allocator_type;
|
||||
|
||||
typedef boost::container::vector<element_type, allocator_type> elements_type;
|
||||
|
||||
template <typename Al>
|
||||
inline weak_internal_node(Al const& al)
|
||||
: elements(al)
|
||||
: elements(allocator_type(al))
|
||||
{}
|
||||
|
||||
elements_type elements;
|
||||
@@ -40,18 +39,16 @@ template <typename Value, typename Parameters, typename Box, typename Allocators
|
||||
struct weak_leaf
|
||||
: public weak_node<Value, Parameters, Box, Allocators, Tag>
|
||||
{
|
||||
typedef boost::container::vector
|
||||
typedef typename boost::container::allocator_traits
|
||||
<
|
||||
Value,
|
||||
typename Allocators::leaf_allocator_type::template rebind
|
||||
<
|
||||
Value
|
||||
>::other
|
||||
> elements_type;
|
||||
typename Allocators::leaf_allocator_type
|
||||
>::template rebind_alloc<Value> allocator_type;
|
||||
|
||||
typedef boost::container::vector<Value, allocator_type> elements_type;
|
||||
|
||||
template <typename Al>
|
||||
inline weak_leaf(Al const& al)
|
||||
: elements(al)
|
||||
: elements(allocator_type(al))
|
||||
{}
|
||||
|
||||
elements_type elements;
|
||||
@@ -87,49 +84,80 @@ struct visitor<Value, Parameters, Box, Allocators, node_weak_dynamic_tag, IsVisi
|
||||
|
||||
// allocators
|
||||
|
||||
template <typename Allocator, typename Value, typename Parameters, typename Box, typename Tag>
|
||||
struct internal_node_alloc
|
||||
{
|
||||
typedef typename internal_nod
|
||||
<
|
||||
Value, Parameters, Box,
|
||||
allocators<Allocator, Value, Parameters, Box, Tag>,
|
||||
Tag
|
||||
>::type node_type;
|
||||
|
||||
typedef typename boost::container::allocator_traits
|
||||
<
|
||||
Allocator
|
||||
>::template rebind_alloc<node_type> type;
|
||||
};
|
||||
|
||||
template <typename Allocator, typename Value, typename Parameters, typename Box, typename Tag>
|
||||
struct leaf_alloc
|
||||
{
|
||||
typedef typename leaf
|
||||
<
|
||||
Value, Parameters, Box,
|
||||
allocators<Allocator, Value, Parameters, Box, Tag>,
|
||||
Tag
|
||||
>::type node_type;
|
||||
|
||||
typedef typename ::boost::container::allocator_traits
|
||||
<
|
||||
Allocator
|
||||
>::template rebind_alloc<node_type> type;
|
||||
};
|
||||
|
||||
template <typename Allocator, typename Value, typename Parameters, typename Box>
|
||||
class allocators<Allocator, Value, Parameters, Box, node_weak_dynamic_tag>
|
||||
: public Allocator::template rebind<
|
||||
typename internal_node<
|
||||
Value, Parameters, Box,
|
||||
allocators<Allocator, Value, Parameters, Box, node_weak_dynamic_tag>,
|
||||
node_weak_dynamic_tag
|
||||
>::type
|
||||
>::other
|
||||
, public Allocator::template rebind<
|
||||
typename leaf<
|
||||
Value, Parameters, Box,
|
||||
allocators<Allocator, Value, Parameters, Box, node_weak_dynamic_tag>,
|
||||
node_weak_dynamic_tag
|
||||
>::type
|
||||
>::other
|
||||
: public internal_node_alloc<Allocator, Value, Parameters, Box, node_weak_dynamic_tag>::type
|
||||
, public leaf_alloc<Allocator, Value, Parameters, Box, node_weak_dynamic_tag>::type
|
||||
{
|
||||
typedef typename Allocator::template rebind<
|
||||
Value
|
||||
>::other value_allocator_type;
|
||||
typedef detail::rtree::internal_node_alloc
|
||||
<
|
||||
Allocator, Value, Parameters, Box, node_weak_dynamic_tag
|
||||
> internal_node_alloc;
|
||||
|
||||
typedef detail::rtree::leaf_alloc
|
||||
<
|
||||
Allocator, Value, Parameters, Box, node_weak_dynamic_tag
|
||||
> leaf_alloc;
|
||||
|
||||
typedef detail::rtree::node_alloc
|
||||
<
|
||||
Allocator, Value, Parameters, Box, node_weak_dynamic_tag
|
||||
> node_alloc;
|
||||
|
||||
public:
|
||||
typedef typename internal_node_alloc::type internal_node_allocator_type;
|
||||
typedef typename leaf_alloc::type leaf_allocator_type;
|
||||
typedef typename node_alloc::traits::pointer node_pointer;
|
||||
|
||||
private:
|
||||
typedef typename boost::container::allocator_traits
|
||||
<
|
||||
leaf_allocator_type // leaf_allocator_type for consistency with weak_leaf
|
||||
>::template rebind_alloc<Value> value_allocator_type;
|
||||
typedef boost::container::allocator_traits<value_allocator_type> value_allocator_traits;
|
||||
|
||||
public:
|
||||
typedef Allocator allocator_type;
|
||||
|
||||
typedef Value value_type;
|
||||
typedef typename value_allocator_type::reference reference;
|
||||
typedef typename value_allocator_type::const_reference const_reference;
|
||||
typedef typename value_allocator_type::size_type size_type;
|
||||
typedef typename value_allocator_type::difference_type difference_type;
|
||||
typedef typename value_allocator_type::pointer pointer;
|
||||
typedef typename value_allocator_type::const_pointer const_pointer;
|
||||
|
||||
typedef typename Allocator::template rebind<
|
||||
typename node<Value, Parameters, Box, allocators, node_weak_dynamic_tag>::type
|
||||
>::other::pointer node_pointer;
|
||||
|
||||
typedef typename Allocator::template rebind<
|
||||
typename internal_node<Value, Parameters, Box, allocators, node_weak_dynamic_tag>::type
|
||||
>::other internal_node_allocator_type;
|
||||
|
||||
typedef typename Allocator::template rebind<
|
||||
typename leaf<Value, Parameters, Box, allocators, node_weak_dynamic_tag>::type
|
||||
>::other leaf_allocator_type;
|
||||
typedef typename value_allocator_traits::reference reference;
|
||||
typedef typename value_allocator_traits::const_reference const_reference;
|
||||
typedef typename value_allocator_traits::size_type size_type;
|
||||
typedef typename value_allocator_traits::difference_type difference_type;
|
||||
typedef typename value_allocator_traits::pointer pointer;
|
||||
typedef typename value_allocator_traits::const_pointer const_pointer;
|
||||
|
||||
inline allocators()
|
||||
: internal_node_allocator_type()
|
||||
@@ -199,7 +227,7 @@ struct create_weak_node
|
||||
|
||||
scoped_deallocator<AllocNode> deallocator(p, alloc_node);
|
||||
|
||||
Al::construct(alloc_node, boost::addressof(*p), alloc_node);
|
||||
Al::construct(alloc_node, boost::to_address(p), alloc_node);
|
||||
|
||||
deallocator.release();
|
||||
return p;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// R-tree nodes based on static conversion, storing static-size containers
|
||||
//
|
||||
// Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
// Copyright (c) 2011-2018 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -75,47 +75,46 @@ struct visitor<Value, Parameters, Box, Allocators, node_weak_static_tag, IsVisit
|
||||
|
||||
template <typename Allocator, typename Value, typename Parameters, typename Box>
|
||||
class allocators<Allocator, Value, Parameters, Box, node_weak_static_tag>
|
||||
: public Allocator::template rebind<
|
||||
typename internal_node<
|
||||
Value, Parameters, Box,
|
||||
allocators<Allocator, Value, Parameters, Box, node_weak_static_tag>,
|
||||
node_weak_static_tag
|
||||
>::type
|
||||
>::other
|
||||
, public Allocator::template rebind<
|
||||
typename leaf<
|
||||
Value, Parameters, Box,
|
||||
allocators<Allocator, Value, Parameters, Box, node_weak_static_tag>,
|
||||
node_weak_static_tag
|
||||
>::type
|
||||
>::other
|
||||
: public detail::rtree::internal_node_alloc<Allocator, Value, Parameters, Box, node_weak_static_tag>::type
|
||||
, public detail::rtree::leaf_alloc<Allocator, Value, Parameters, Box, node_weak_static_tag>::type
|
||||
{
|
||||
typedef typename Allocator::template rebind<
|
||||
Value
|
||||
>::other value_allocator_type;
|
||||
typedef detail::rtree::internal_node_alloc
|
||||
<
|
||||
Allocator, Value, Parameters, Box, node_weak_static_tag
|
||||
> internal_node_alloc;
|
||||
|
||||
typedef detail::rtree::leaf_alloc
|
||||
<
|
||||
Allocator, Value, Parameters, Box, node_weak_static_tag
|
||||
> leaf_alloc;
|
||||
|
||||
typedef detail::rtree::node_alloc
|
||||
<
|
||||
Allocator, Value, Parameters, Box, node_weak_static_tag
|
||||
> node_alloc;
|
||||
|
||||
public:
|
||||
typedef typename internal_node_alloc::type internal_node_allocator_type;
|
||||
typedef typename leaf_alloc::type leaf_allocator_type;
|
||||
typedef typename node_alloc::traits::pointer node_pointer;
|
||||
|
||||
private:
|
||||
typedef typename boost::container::allocator_traits
|
||||
<
|
||||
leaf_allocator_type
|
||||
>::template rebind_alloc<Value> value_allocator_type;
|
||||
typedef boost::container::allocator_traits<value_allocator_type> value_allocator_traits;
|
||||
|
||||
public:
|
||||
typedef Allocator allocator_type;
|
||||
|
||||
typedef Value value_type;
|
||||
typedef value_type & reference;
|
||||
typedef const value_type & const_reference;
|
||||
typedef typename value_allocator_type::size_type size_type;
|
||||
typedef typename value_allocator_type::difference_type difference_type;
|
||||
typedef typename value_allocator_type::pointer pointer;
|
||||
typedef typename value_allocator_type::const_pointer const_pointer;
|
||||
|
||||
typedef typename Allocator::template rebind<
|
||||
typename node<Value, Parameters, Box, allocators, node_weak_static_tag>::type
|
||||
>::other::pointer node_pointer;
|
||||
|
||||
typedef typename Allocator::template rebind<
|
||||
typename internal_node<Value, Parameters, Box, allocators, node_weak_static_tag>::type
|
||||
>::other internal_node_allocator_type;
|
||||
|
||||
typedef typename Allocator::template rebind<
|
||||
typename leaf<Value, Parameters, Box, allocators, node_weak_static_tag>::type
|
||||
>::other leaf_allocator_type;
|
||||
typedef typename value_allocator_traits::reference reference;
|
||||
typedef typename value_allocator_traits::const_reference const_reference;
|
||||
typedef typename value_allocator_traits::size_type size_type;
|
||||
typedef typename value_allocator_traits::difference_type difference_type;
|
||||
typedef typename value_allocator_traits::pointer pointer;
|
||||
typedef typename value_allocator_traits::const_pointer const_pointer;
|
||||
|
||||
inline allocators()
|
||||
: internal_node_allocator_type()
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_PACK_CREATE_HPP
|
||||
#define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_PACK_CREATE_HPP
|
||||
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/expand.hpp>
|
||||
#include <boost/geometry/index/detail/algorithms/bounds.hpp>
|
||||
#include <boost/geometry/index/detail/algorithms/nth_element.hpp>
|
||||
@@ -383,7 +385,7 @@ private:
|
||||
inline static
|
||||
subtree_elements_counts calculate_subtree_elements_counts(std::size_t elements_count, parameters_type const& parameters, size_type & leafs_level)
|
||||
{
|
||||
boost::ignore_unused_variable_warning(parameters);
|
||||
boost::ignore_unused(parameters);
|
||||
|
||||
subtree_elements_counts res(1, 1);
|
||||
leafs_level = 0;
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
|
||||
#include <boost/geometry/index/detail/algorithms/content.hpp>
|
||||
#include <boost/geometry/index/detail/algorithms/union_content.hpp>
|
||||
|
||||
@@ -75,7 +77,7 @@ inline void pick_seeds(Elements const& elements,
|
||||
}
|
||||
}
|
||||
|
||||
::boost::ignore_unused_variable_warning(parameters);
|
||||
::boost::ignore_unused(parameters);
|
||||
}
|
||||
|
||||
} // namespace quadratic
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// R-tree R*-tree next node choosing algorithm implementation
|
||||
//
|
||||
// Copyright (c) 2011-2017 Adam Wulkiewicz, Lodz, Poland.
|
||||
// Copyright (c) 2011-2019 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/expand.hpp>
|
||||
|
||||
#include <boost/geometry/index/detail/algorithms/content.hpp>
|
||||
@@ -48,7 +50,7 @@ public:
|
||||
parameters_type const& parameters,
|
||||
size_t node_relative_level)
|
||||
{
|
||||
::boost::ignore_unused_variable_warning(parameters);
|
||||
::boost::ignore_unused(parameters);
|
||||
|
||||
children_type & children = rtree::elements(n);
|
||||
|
||||
@@ -63,6 +65,20 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
struct child_contents
|
||||
{
|
||||
content_type content_diff;
|
||||
content_type content;
|
||||
size_t i;
|
||||
|
||||
void set(size_t i_, content_type const& content_, content_type const& content_diff_)
|
||||
{
|
||||
i = i_;
|
||||
content = content_;
|
||||
content_diff = content_diff_;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Indexable>
|
||||
static inline size_t choose_by_minimum_overlap_cost(children_type const& children,
|
||||
Indexable const& indexable,
|
||||
@@ -75,10 +91,8 @@ private:
|
||||
size_t choosen_index = 0;
|
||||
|
||||
// create container of children sorted by content enlargement needed to include the new value
|
||||
typedef boost::tuple<size_t, content_type, content_type> child_contents;
|
||||
|
||||
typename rtree::container_from_elements_type<children_type, child_contents>::type children_contents;
|
||||
children_contents.resize(children_count);
|
||||
typename rtree::container_from_elements_type<children_type, child_contents>::type
|
||||
children_contents(children_count);
|
||||
|
||||
for ( size_t i = 0 ; i < children_count ; ++i )
|
||||
{
|
||||
@@ -92,7 +106,7 @@ private:
|
||||
content_type content = index::detail::content(box_exp);
|
||||
content_type content_diff = content - index::detail::content(ch_i.first);
|
||||
|
||||
children_contents[i] = boost::make_tuple(i, content_diff, content);
|
||||
children_contents[i].set(i, content, content_diff);
|
||||
|
||||
if ( content_diff < min_content_diff ||
|
||||
(content_diff == min_content_diff && content < min_content) )
|
||||
@@ -123,10 +137,10 @@ private:
|
||||
return choosen_index;
|
||||
}
|
||||
|
||||
static inline bool content_diff_less(boost::tuple<size_t, content_type, content_type> const& p1, boost::tuple<size_t, content_type, content_type> const& p2)
|
||||
static inline bool content_diff_less(child_contents const& p1, child_contents const& p2)
|
||||
{
|
||||
return boost::get<1>(p1) < boost::get<1>(p2) ||
|
||||
(boost::get<1>(p1) == boost::get<1>(p2) && boost::get<2>(p1) < boost::get<2>(p2));
|
||||
return p1.content_diff < p2.content_diff
|
||||
|| (p1.content_diff == p2.content_diff && (p1.content) < (p2.content));
|
||||
}
|
||||
|
||||
template <typename Indexable, typename ChildrenContents>
|
||||
@@ -146,8 +160,12 @@ private:
|
||||
content_type smallest_content = (std::numeric_limits<content_type>::max)();
|
||||
|
||||
// for each child node
|
||||
for (size_t i = 0 ; i < first_n_children_count ; ++i )
|
||||
for (size_t first_i = 0 ; first_i < first_n_children_count ; ++first_i)
|
||||
{
|
||||
size_t i = children_contents[first_i].i;
|
||||
content_type const& content = children_contents[first_i].content;
|
||||
content_type const& content_diff = children_contents[first_i].content_diff;
|
||||
|
||||
child_type const& ch_i = children[i];
|
||||
|
||||
Box box_exp(ch_i.first);
|
||||
@@ -171,9 +189,6 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
content_type content = boost::get<2>(children_contents[i]);
|
||||
content_type content_diff = boost::get<1>(children_contents[i]);
|
||||
|
||||
// update result
|
||||
if ( overlap_diff < smallest_overlap_diff ||
|
||||
( overlap_diff == smallest_overlap_diff && ( content_diff < smallest_content_diff ||
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_RSTAR_INSERT_HPP
|
||||
#define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_RSTAR_INSERT_HPP
|
||||
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
|
||||
#include <boost/geometry/index/detail/algorithms/content.hpp>
|
||||
|
||||
namespace boost { namespace geometry { namespace index {
|
||||
@@ -123,7 +125,7 @@ public:
|
||||
}
|
||||
BOOST_CATCH_END
|
||||
|
||||
::boost::ignore_unused_variable_warning(parameters);
|
||||
::boost::ignore_unused(parameters);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_RSTAR_REDISTRIBUTE_ELEMENTS_HPP
|
||||
#define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_RSTAR_REDISTRIBUTE_ELEMENTS_HPP
|
||||
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
|
||||
#include <boost/geometry/index/detail/algorithms/intersection_content.hpp>
|
||||
#include <boost/geometry/index/detail/algorithms/margin.hpp>
|
||||
#include <boost/geometry/index/detail/algorithms/nth_element.hpp>
|
||||
@@ -158,7 +160,7 @@ struct choose_split_axis_and_index_for_corner
|
||||
}
|
||||
}
|
||||
|
||||
::boost::ignore_unused_variable_warning(parameters);
|
||||
::boost::ignore_unused(parameters);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// R-tree removing visitor implementation
|
||||
//
|
||||
// Copyright (c) 2011-2015 Adam Wulkiewicz, Lodz, Poland.
|
||||
// Copyright (c) 2011-2017 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#include <boost/geometry/index/detail/rtree/visitors/is_leaf.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/covered_by.hpp>
|
||||
#include <boost/geometry/algorithms/detail/covered_by/interface.hpp>
|
||||
|
||||
namespace boost { namespace geometry { namespace index {
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
#include <boost/swap.hpp>
|
||||
#include <boost/integer.hpp>
|
||||
|
||||
@@ -75,8 +76,7 @@ struct checker
|
||||
{
|
||||
BOOST_GEOMETRY_INDEX_ASSERT(s <= v.capacity(), "size too big");
|
||||
|
||||
::boost::ignore_unused_variable_warning(v);
|
||||
::boost::ignore_unused_variable_warning(s);
|
||||
::boost::ignore_unused(v, s);
|
||||
}
|
||||
|
||||
static inline void throw_out_of_bounds(Varray const& v, size_type i)
|
||||
@@ -84,39 +84,35 @@ struct checker
|
||||
if ( v.size() <= i )
|
||||
throw_out_of_range("index out of bounds");
|
||||
|
||||
::boost::ignore_unused_variable_warning(v);
|
||||
::boost::ignore_unused_variable_warning(i);
|
||||
::boost::ignore_unused(v, i);
|
||||
}
|
||||
|
||||
static inline void check_index(Varray const& v, size_type i)
|
||||
{
|
||||
BOOST_GEOMETRY_INDEX_ASSERT(i < v.size(), "index out of bounds");
|
||||
|
||||
::boost::ignore_unused_variable_warning(v);
|
||||
::boost::ignore_unused_variable_warning(i);
|
||||
::boost::ignore_unused(v, i);
|
||||
}
|
||||
|
||||
static inline void check_not_empty(Varray const& v)
|
||||
{
|
||||
BOOST_GEOMETRY_INDEX_ASSERT(!v.empty(), "the container is empty");
|
||||
|
||||
::boost::ignore_unused_variable_warning(v);
|
||||
::boost::ignore_unused(v);
|
||||
}
|
||||
|
||||
static inline void check_iterator_end_neq(Varray const& v, const_iterator position)
|
||||
{
|
||||
BOOST_GEOMETRY_INDEX_ASSERT(v.begin() <= position && position < v.end(), "iterator out of bounds");
|
||||
|
||||
::boost::ignore_unused_variable_warning(v);
|
||||
::boost::ignore_unused_variable_warning(position);
|
||||
::boost::ignore_unused(v, position);
|
||||
}
|
||||
|
||||
static inline void check_iterator_end_eq(Varray const& v, const_iterator position)
|
||||
{
|
||||
BOOST_GEOMETRY_INDEX_ASSERT(v.begin() <= position && position <= v.end(), "iterator out of bounds");
|
||||
|
||||
::boost::ignore_unused_variable_warning(v);
|
||||
::boost::ignore_unused_variable_warning(position);
|
||||
::boost::ignore_unused(v, position);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_GEOMETRY_INDEX_EQUAL_TO_HPP
|
||||
#define BOOST_GEOMETRY_INDEX_EQUAL_TO_HPP
|
||||
|
||||
#include <boost/geometry/algorithms/equals.hpp>
|
||||
#include <boost/geometry/algorithms/detail/equals/interface.hpp>
|
||||
#include <boost/geometry/index/indexable.hpp>
|
||||
|
||||
namespace boost { namespace geometry { namespace index { namespace detail {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Boost.Geometry Index
|
||||
//
|
||||
// Copyright (c) 2011-2015 Adam Wulkiewicz, Lodz, Poland.
|
||||
// Copyright (c) 2011-2019 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -10,11 +10,44 @@
|
||||
#define BOOST_GEOMETRY_INDEX_INDEXABLE_HPP
|
||||
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/type_traits/is_reference.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
#include <boost/geometry/index/detail/is_indexable.hpp>
|
||||
|
||||
namespace boost { namespace geometry { namespace index { namespace detail {
|
||||
|
||||
template <typename T>
|
||||
struct remove_cr
|
||||
: boost::remove_const
|
||||
<
|
||||
typename boost::remove_reference<T>::type
|
||||
>
|
||||
{};
|
||||
|
||||
template <typename From, typename To>
|
||||
struct is_referencable
|
||||
: boost::is_same
|
||||
<
|
||||
typename remove_cr<From>::type,
|
||||
typename remove_cr<To>::type
|
||||
>
|
||||
{};
|
||||
|
||||
template <typename Indexable, typename V>
|
||||
inline Indexable const& indexable_prevent_any_type(V const& )
|
||||
{
|
||||
BOOST_MPL_ASSERT_MSG(
|
||||
(false),
|
||||
UNEXPECTED_TYPE,
|
||||
(V)
|
||||
);
|
||||
return Indexable();
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief The function object extracting Indexable from Value.
|
||||
|
||||
@@ -47,6 +80,15 @@ struct indexable
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Prevent reference to temporary for types convertible to Value.
|
||||
*/
|
||||
template <typename V>
|
||||
inline result_type operator()(V const& v) const
|
||||
{
|
||||
return indexable_prevent_any_type<Value>(v);
|
||||
}
|
||||
};
|
||||
|
||||
/*!
|
||||
@@ -55,11 +97,13 @@ struct indexable
|
||||
This specialization translates from std::pair<Indexable, T2>.
|
||||
|
||||
\tparam Indexable The Indexable type.
|
||||
\tparam T2 The second type.
|
||||
\tparam Second The second type.
|
||||
*/
|
||||
template <typename Indexable, typename T2>
|
||||
struct indexable<std::pair<Indexable, T2>, false>
|
||||
template <typename Indexable, typename Second>
|
||||
struct indexable<std::pair<Indexable, Second>, false>
|
||||
{
|
||||
typedef std::pair<Indexable, Second> value_type;
|
||||
|
||||
BOOST_MPL_ASSERT_MSG(
|
||||
(detail::is_indexable<Indexable>::value),
|
||||
NOT_VALID_INDEXABLE_TYPE,
|
||||
@@ -75,24 +119,51 @@ struct indexable<std::pair<Indexable, T2>, false>
|
||||
\param v The value.
|
||||
\return The indexable.
|
||||
*/
|
||||
inline result_type operator()(std::pair<Indexable, T2> const& v) const
|
||||
inline result_type operator()(value_type const& v) const
|
||||
{
|
||||
return v.first;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Return indexable extracted from compatible type different than value_type.
|
||||
|
||||
\param v The value.
|
||||
\return The indexable.
|
||||
*/
|
||||
template <typename I, typename S>
|
||||
inline result_type operator()(std::pair<I, S> const& v) const
|
||||
{
|
||||
BOOST_MPL_ASSERT_MSG(
|
||||
(is_referencable<I, result_type>::value),
|
||||
UNEXPECTED_TYPE,
|
||||
(std::pair<I, S>)
|
||||
);
|
||||
return v.first;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Prevent reference to temporary for types convertible to Value.
|
||||
*/
|
||||
template <typename V>
|
||||
inline result_type operator()(V const& v) const
|
||||
{
|
||||
return indexable_prevent_any_type<Indexable>(v);
|
||||
}
|
||||
};
|
||||
|
||||
/*!
|
||||
\brief The function object extracting Indexable from Value.
|
||||
|
||||
This specialization translates from boost::tuple<Indexable, ...>.
|
||||
This specialization translates from boost::tuple<Indexable, ...>
|
||||
or boost::tuples::cons<Indexable, ...>.
|
||||
|
||||
\tparam Value The Value type.
|
||||
\tparam Indexable The Indexable type.
|
||||
*/
|
||||
template <typename Indexable, typename T1, typename T2, typename T3, typename T4,
|
||||
typename T5, typename T6, typename T7, typename T8, typename T9>
|
||||
struct indexable<boost::tuple<Indexable, T1, T2, T3, T4, T5, T6, T7, T8, T9>, false>
|
||||
template <typename Value, typename Indexable>
|
||||
struct indexable_boost_tuple
|
||||
{
|
||||
typedef boost::tuple<Indexable, T1, T2, T3, T4, T5, T6, T7, T8, T9> value_type;
|
||||
typedef Value value_type;
|
||||
|
||||
BOOST_MPL_ASSERT_MSG(
|
||||
(detail::is_indexable<Indexable>::value),
|
||||
@@ -113,8 +184,85 @@ struct indexable<boost::tuple<Indexable, T1, T2, T3, T4, T5, T6, T7, T8, T9>, fa
|
||||
{
|
||||
return boost::get<0>(v);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Return indexable extracted from compatible type different than value_type.
|
||||
|
||||
\param v The value.
|
||||
\return The indexable.
|
||||
*/
|
||||
template <typename I, typename U1, typename U2, typename U3, typename U4,
|
||||
typename U5, typename U6, typename U7, typename U8, typename U9>
|
||||
inline result_type operator()(boost::tuple<I, U1, U2, U3, U4, U5, U6, U7, U8, U9> const& v) const
|
||||
{
|
||||
BOOST_MPL_ASSERT_MSG(
|
||||
(is_referencable<I, result_type>::value),
|
||||
UNEXPECTED_TYPE,
|
||||
(boost::tuple<I, U1, U2, U3, U4, U5, U6, U7, U8, U9>)
|
||||
);
|
||||
return boost::get<0>(v);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Return indexable extracted from compatible type different than value_type.
|
||||
|
||||
\param v The value.
|
||||
\return The indexable.
|
||||
*/
|
||||
template <typename I, typename T>
|
||||
inline result_type operator()(boost::tuples::cons<I, T> const& v) const
|
||||
{
|
||||
BOOST_MPL_ASSERT_MSG(
|
||||
(is_referencable<I, result_type>::value),
|
||||
UNEXPECTED_TYPE,
|
||||
(boost::tuples::cons<I, T>)
|
||||
);
|
||||
return boost::get<0>(v);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Prevent reference to temporary for types convertible to Value.
|
||||
*/
|
||||
template <typename V>
|
||||
inline result_type operator()(V const& v) const
|
||||
{
|
||||
return indexable_prevent_any_type<Indexable>(v);
|
||||
}
|
||||
};
|
||||
|
||||
/*!
|
||||
\brief The function object extracting Indexable from Value.
|
||||
|
||||
This specialization translates from boost::tuple<Indexable, ...>.
|
||||
|
||||
\tparam Indexable The Indexable type.
|
||||
*/
|
||||
template <typename Indexable, typename T1, typename T2, typename T3, typename T4,
|
||||
typename T5, typename T6, typename T7, typename T8, typename T9>
|
||||
struct indexable<boost::tuple<Indexable, T1, T2, T3, T4, T5, T6, T7, T8, T9>, false>
|
||||
: indexable_boost_tuple
|
||||
<
|
||||
boost::tuple<Indexable, T1, T2, T3, T4, T5, T6, T7, T8, T9>,
|
||||
Indexable
|
||||
>
|
||||
{};
|
||||
|
||||
/*!
|
||||
\brief The function object extracting Indexable from Value.
|
||||
|
||||
This specialization translates from boost::tuples::cons<Indexable, ...>.
|
||||
|
||||
\tparam Indexable The Indexable type.
|
||||
*/
|
||||
template <typename Indexable, typename Tail>
|
||||
struct indexable<boost::tuples::cons<Indexable, Tail>, false>
|
||||
: indexable_boost_tuple
|
||||
<
|
||||
boost::tuples::cons<Indexable, Tail>,
|
||||
Indexable
|
||||
>
|
||||
{};
|
||||
|
||||
}}}} // namespace boost::geometry::index::detail
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_HDR_TUPLE) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
@@ -155,6 +303,32 @@ struct indexable<std::tuple<Indexable, Args...>, false>
|
||||
{
|
||||
return std::get<0>(v);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Return indexable extracted from compatible type different than value_type.
|
||||
|
||||
\param v The value.
|
||||
\return The indexable.
|
||||
*/
|
||||
template <typename I, typename ...A>
|
||||
inline result_type operator()(std::tuple<I, A...> const& v) const
|
||||
{
|
||||
BOOST_MPL_ASSERT_MSG(
|
||||
(is_referencable<I, result_type>::value),
|
||||
UNEXPECTED_TYPE,
|
||||
(std::tuple<I, A...>)
|
||||
);
|
||||
return std::get<0>(v);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Prevent reference to temporary for types convertible to Value.
|
||||
*/
|
||||
template <typename V>
|
||||
inline result_type operator()(V const& v) const
|
||||
{
|
||||
return indexable_prevent_any_type<Indexable>(v);
|
||||
}
|
||||
};
|
||||
|
||||
}}}} // namespace boost::geometry::index::detail
|
||||
@@ -189,6 +363,20 @@ struct indexable
|
||||
{
|
||||
return detail::indexable<Value>::operator()(v);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Return indexable extracted from the value. Overload for types
|
||||
compatible with Value but different yet holding referencable
|
||||
Indexable, e.g. tuple containing a reference.
|
||||
|
||||
\param v The value.
|
||||
\return The indexable.
|
||||
*/
|
||||
template <typename V>
|
||||
inline result_type operator()(V const& v) const
|
||||
{
|
||||
return detail::indexable<Value>::operator()(v);
|
||||
}
|
||||
};
|
||||
|
||||
}}} // namespace boost::geometry::index
|
||||
|
||||
@@ -20,10 +20,15 @@
|
||||
namespace boost { namespace geometry { namespace index {
|
||||
|
||||
template <class Container>
|
||||
class insert_iterator :
|
||||
public std::iterator<std::output_iterator_tag, void, void, void, void>
|
||||
class insert_iterator
|
||||
{
|
||||
public:
|
||||
typedef std::output_iterator_tag iterator_category;
|
||||
typedef void value_type;
|
||||
typedef void difference_type;
|
||||
typedef void pointer;
|
||||
typedef void reference;
|
||||
|
||||
typedef Container container_type;
|
||||
|
||||
inline explicit insert_iterator(Container & c)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Spatial query predicates
|
||||
//
|
||||
// Copyright (c) 2011-2015 Adam Wulkiewicz, Lodz, Poland.
|
||||
// Copyright (c) 2011-2018 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -23,9 +23,10 @@ namespace boost { namespace geometry { namespace index {
|
||||
/*!
|
||||
\brief Generate \c contains() predicate.
|
||||
|
||||
Generate a predicate defining Value and Geometry relationship.
|
||||
Value will be returned by the query if <tt>bg::within(Geometry, Indexable)</tt>
|
||||
returns true.
|
||||
Generate a predicate defining Value and Geometry relationship. With this
|
||||
predicate query returns indexed Values that contain passed Geometry.
|
||||
Value is returned by the query if <tt>bg::within(Geometry, Indexable)</tt>
|
||||
returns <tt>true</tt>.
|
||||
|
||||
\par Example
|
||||
\verbatim
|
||||
@@ -53,9 +54,10 @@ contains(Geometry const& g)
|
||||
/*!
|
||||
\brief Generate \c covered_by() predicate.
|
||||
|
||||
Generate a predicate defining Value and Geometry relationship.
|
||||
Value will be returned by the query if <tt>bg::covered_by(Indexable, Geometry)</tt>
|
||||
returns true.
|
||||
Generate a predicate defining Value and Geometry relationship. With this
|
||||
predicate query returns indexed Values that are covered by passed Geometry.
|
||||
Value is returned by the query if <tt>bg::covered_by(Indexable, Geometry)</tt>
|
||||
returns <tt>true</tt>.
|
||||
|
||||
\par Example
|
||||
\verbatim
|
||||
@@ -83,9 +85,10 @@ covered_by(Geometry const& g)
|
||||
/*!
|
||||
\brief Generate \c covers() predicate.
|
||||
|
||||
Generate a predicate defining Value and Geometry relationship.
|
||||
Value will be returned by the query if <tt>bg::covered_by(Geometry, Indexable)</tt>
|
||||
returns true.
|
||||
Generate a predicate defining Value and Geometry relationship. With this
|
||||
predicate query returns indexed Values that cover passed Geometry.
|
||||
Value is returned by the query if <tt>bg::covered_by(Geometry, Indexable)</tt>
|
||||
returns <tt>true</tt>.
|
||||
|
||||
\par Example
|
||||
\verbatim
|
||||
@@ -113,9 +116,10 @@ covers(Geometry const& g)
|
||||
/*!
|
||||
\brief Generate \c disjoint() predicate.
|
||||
|
||||
Generate a predicate defining Value and Geometry relationship.
|
||||
Value will be returned by the query if <tt>bg::disjoint(Indexable, Geometry)</tt>
|
||||
returns true.
|
||||
Generate a predicate defining Value and Geometry relationship. With this
|
||||
predicate query returns indexed Values that are disjoint with passed Geometry.
|
||||
Value is returned by the query if <tt>bg::disjoint(Indexable, Geometry)</tt>
|
||||
returns <tt>true</tt>.
|
||||
|
||||
\par Example
|
||||
\verbatim
|
||||
@@ -143,9 +147,10 @@ disjoint(Geometry const& g)
|
||||
/*!
|
||||
\brief Generate \c intersects() predicate.
|
||||
|
||||
Generate a predicate defining Value and Geometry relationship.
|
||||
Value will be returned by the query if <tt>bg::intersects(Indexable, Geometry)</tt>
|
||||
returns true.
|
||||
Generate a predicate defining Value and Geometry relationship. With this
|
||||
predicate query returns indexed Values that intersect passed Geometry.
|
||||
Value is returned by the query if <tt>bg::intersects(Indexable, Geometry)</tt>
|
||||
returns <tt>true</tt>.
|
||||
|
||||
\par Example
|
||||
\verbatim
|
||||
@@ -175,9 +180,10 @@ intersects(Geometry const& g)
|
||||
/*!
|
||||
\brief Generate \c overlaps() predicate.
|
||||
|
||||
Generate a predicate defining Value and Geometry relationship.
|
||||
Value will be returned by the query if <tt>bg::overlaps(Indexable, Geometry)</tt>
|
||||
returns true.
|
||||
Generate a predicate defining Value and Geometry relationship. With this
|
||||
predicate query returns indexed Values that overlap passed Geometry.
|
||||
Value is returned by the query if <tt>bg::overlaps(Indexable, Geometry)</tt>
|
||||
returns <tt>true</tt>.
|
||||
|
||||
\par Example
|
||||
\verbatim
|
||||
@@ -207,9 +213,10 @@ overlaps(Geometry const& g)
|
||||
/*!
|
||||
\brief Generate \c touches() predicate.
|
||||
|
||||
Generate a predicate defining Value and Geometry relationship.
|
||||
Value will be returned by the query if <tt>bg::touches(Indexable, Geometry)</tt>
|
||||
returns true.
|
||||
Generate a predicate defining Value and Geometry relationship. With this
|
||||
predicate query returns indexed Values that touch passed Geometry.
|
||||
Value is returned by the query if <tt>bg::touches(Indexable, Geometry)</tt>
|
||||
returns <tt>true</tt>.
|
||||
|
||||
\ingroup predicates
|
||||
|
||||
@@ -234,9 +241,10 @@ touches(Geometry const& g)
|
||||
/*!
|
||||
\brief Generate \c within() predicate.
|
||||
|
||||
Generate a predicate defining Value and Geometry relationship.
|
||||
Value will be returned by the query if <tt>bg::within(Indexable, Geometry)</tt>
|
||||
returns true.
|
||||
Generate a predicate defining Value and Geometry relationship. With this
|
||||
predicate query returns indexed Values that are within passed Geometry.
|
||||
Value is returned by the query if <tt>bg::within(Indexable, Geometry)</tt>
|
||||
returns <tt>true</tt>.
|
||||
|
||||
\par Example
|
||||
\verbatim
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// R-tree implementation
|
||||
//
|
||||
// Copyright (c) 2008 Federico J. Fernandez.
|
||||
// Copyright (c) 2011-2015 Adam Wulkiewicz, Lodz, Poland.
|
||||
// Copyright (c) 2011-2019 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -16,25 +16,24 @@
|
||||
#include <algorithm>
|
||||
|
||||
// Boost
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/container/new_allocator.hpp>
|
||||
#include <boost/move/move.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
|
||||
// Boost.Geometry
|
||||
#include <boost/geometry/algorithms/detail/comparable_distance/interface.hpp>
|
||||
#include <boost/geometry/algorithms/detail/covered_by/interface.hpp>
|
||||
#include <boost/geometry/algorithms/detail/disjoint/interface.hpp>
|
||||
#include <boost/geometry/algorithms/detail/equals/interface.hpp>
|
||||
#include <boost/geometry/algorithms/detail/intersects/interface.hpp>
|
||||
#include <boost/geometry/algorithms/detail/overlaps/interface.hpp>
|
||||
#include <boost/geometry/algorithms/detail/touches/interface.hpp>
|
||||
#include <boost/geometry/algorithms/detail/within/interface.hpp>
|
||||
#include <boost/geometry/algorithms/centroid.hpp>
|
||||
#include <boost/geometry/algorithms/covered_by.hpp>
|
||||
#include <boost/geometry/algorithms/disjoint.hpp>
|
||||
#include <boost/geometry/algorithms/equals.hpp>
|
||||
#include <boost/geometry/algorithms/intersects.hpp>
|
||||
#include <boost/geometry/algorithms/overlaps.hpp>
|
||||
#include <boost/geometry/algorithms/touches.hpp>
|
||||
#include <boost/geometry/algorithms/within.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/point.hpp>
|
||||
#include <boost/geometry/geometries/box.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/strategies.hpp>
|
||||
|
||||
// Boost.Geometry.Index
|
||||
#include <boost/geometry/index/detail/config_begin.hpp>
|
||||
|
||||
@@ -145,12 +144,13 @@ compared left-to-right.
|
||||
\tparam Allocator The allocator used to allocate/deallocate memory,
|
||||
construct/destroy nodes and Values.
|
||||
*/
|
||||
template <
|
||||
template
|
||||
<
|
||||
typename Value,
|
||||
typename Parameters,
|
||||
typename IndexableGetter = index::indexable<Value>,
|
||||
typename EqualTo = index::equal_to<Value>,
|
||||
typename Allocator = std::allocator<Value>
|
||||
typename Allocator = boost::container::new_allocator<Value>
|
||||
>
|
||||
class rtree
|
||||
{
|
||||
@@ -818,7 +818,7 @@ public:
|
||||
If predicates copy throws.
|
||||
|
||||
\warning
|
||||
Only one \c nearest() perdicate may be passed to the query. Passing more of them results in compile-time error.
|
||||
Only one \c nearest() predicate may be passed to the query. Passing more of them results in compile-time error.
|
||||
|
||||
\param predicates Predicates.
|
||||
\param out_it The output iterator, e.g. generated by std::back_inserter().
|
||||
@@ -1083,7 +1083,7 @@ private:
|
||||
method, which most certainly will be faster than the type-erased iterator, you may get the type
|
||||
e.g. by using C++11 decltype or Boost.Typeof library.
|
||||
|
||||
The type of the iterator returned by this method is dfferent than the type returned by qbegin().
|
||||
The type of the iterator returned by this method is different than the type returned by qbegin().
|
||||
|
||||
\par Example
|
||||
\verbatim
|
||||
@@ -1296,32 +1296,18 @@ public:
|
||||
return 0;
|
||||
|
||||
// the input should be convertible to Value or Indexable type
|
||||
|
||||
enum { as_val = 0, as_ind, dont_know };
|
||||
typedef boost::mpl::int_
|
||||
typedef typename index::detail::convertible_type
|
||||
<
|
||||
boost::is_same<ValueOrIndexable, value_type>::value ?
|
||||
as_val :
|
||||
boost::is_same<ValueOrIndexable, indexable_type>::value ?
|
||||
as_ind :
|
||||
boost::is_convertible<ValueOrIndexable, indexable_type>::value ?
|
||||
as_ind :
|
||||
boost::is_convertible<ValueOrIndexable, value_type>::value ?
|
||||
as_val :
|
||||
dont_know
|
||||
> variant;
|
||||
|
||||
BOOST_MPL_ASSERT_MSG((variant::value != dont_know),
|
||||
PASSED_OBJECT_NOT_CONVERTIBLE_TO_VALUE_NOR_INDEXABLE_TYPE,
|
||||
(ValueOrIndexable));
|
||||
|
||||
typedef typename boost::mpl::if_c
|
||||
<
|
||||
variant::value == as_val,
|
||||
ValueOrIndexable,
|
||||
value_type,
|
||||
indexable_type
|
||||
>::type value_or_indexable;
|
||||
|
||||
static const bool is_void = boost::is_same<value_or_indexable, void>::value;
|
||||
BOOST_MPL_ASSERT_MSG((! is_void),
|
||||
PASSED_OBJECT_NOT_CONVERTIBLE_TO_VALUE_NOR_INDEXABLE_TYPE,
|
||||
(ValueOrIndexable));
|
||||
|
||||
// NOTE: If an object of convertible but not the same type is passed
|
||||
// into the function, here a temporary will be created.
|
||||
return this->template raw_count<value_or_indexable>(vori);
|
||||
@@ -1966,7 +1952,7 @@ tree.query(bgi::intersects(box),
|
||||
If Value copy constructor or copy assignment throws.
|
||||
|
||||
\warning
|
||||
Only one \c nearest() perdicate may be passed to the query. Passing more of them results in compile-time error.
|
||||
Only one \c nearest() predicate may be passed to the query. Passing more of them results in compile-time error.
|
||||
|
||||
\ingroup rtree_functions
|
||||
|
||||
@@ -2222,9 +2208,6 @@ struct range_mutable_iterator
|
||||
|
||||
} // namespace boost
|
||||
|
||||
// TODO: don't include the implementation at the end of the file
|
||||
#include <boost/geometry/algorithms/detail/comparable_distance/implementation.hpp>
|
||||
|
||||
#include <boost/geometry/index/detail/config_end.hpp>
|
||||
|
||||
#endif // BOOST_GEOMETRY_INDEX_RTREE_HPP
|
||||
|
||||
Reference in New Issue
Block a user