mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-10 23:42:12 +00:00
raw pointers replaced by allocator pointer
[SVN r82849]
This commit is contained in:
@@ -72,12 +72,12 @@ inline Derived & get(dynamic_node<Value, Parameters, Box, Allocators, Tag> & n)
|
||||
return static_cast<Derived&>(n);
|
||||
}
|
||||
|
||||
template <typename Derived, typename Parameters, typename Value, typename Box, typename Allocators, typename Tag>
|
||||
inline Derived * get(dynamic_node<Value, Parameters, Box, Allocators, Tag> * n)
|
||||
{
|
||||
BOOST_GEOMETRY_INDEX_ASSERT(dynamic_cast<Derived*>(n), "can't cast to a Derived type");
|
||||
return static_cast<Derived*>(n);
|
||||
}
|
||||
//template <typename Derived, typename Parameters, typename Value, typename Box, typename Allocators, typename Tag>
|
||||
//inline Derived * get(dynamic_node<Value, Parameters, Box, Allocators, Tag> * n)
|
||||
//{
|
||||
// BOOST_GEOMETRY_INDEX_ASSERT(dynamic_cast<Derived*>(n), "can't cast to a Derived type");
|
||||
// return static_cast<Derived*>(n);
|
||||
//}
|
||||
|
||||
// apply visitor
|
||||
|
||||
|
||||
@@ -24,9 +24,10 @@ class node_auto_ptr
|
||||
: boost::noncopyable
|
||||
{
|
||||
typedef typename rtree::node<Value, typename Options::parameters_type, Box, Allocators, typename Options::node_tag>::type node;
|
||||
typedef typename Allocators::node_pointer pointer;
|
||||
|
||||
public:
|
||||
node_auto_ptr(node * ptr, Allocators & allocators)
|
||||
node_auto_ptr(pointer ptr, Allocators & allocators)
|
||||
: m_ptr(ptr)
|
||||
, m_allocators(allocators)
|
||||
{}
|
||||
@@ -36,7 +37,7 @@ public:
|
||||
reset();
|
||||
}
|
||||
|
||||
void reset(node * ptr = 0)
|
||||
void reset(pointer ptr = 0)
|
||||
{
|
||||
if ( m_ptr )
|
||||
{
|
||||
@@ -51,7 +52,7 @@ public:
|
||||
m_ptr = 0;
|
||||
}
|
||||
|
||||
node * get() const
|
||||
pointer get() const
|
||||
{
|
||||
return m_ptr;
|
||||
}
|
||||
@@ -61,13 +62,13 @@ public:
|
||||
return *m_ptr;
|
||||
}
|
||||
|
||||
node * operator->() const
|
||||
pointer operator->() const
|
||||
{
|
||||
return m_ptr;
|
||||
}
|
||||
|
||||
private:
|
||||
node * m_ptr;
|
||||
pointer m_ptr;
|
||||
Allocators & m_allocators;
|
||||
};
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ struct dynamic_internal_node<Value, Parameters, Box, Allocators, node_d_mem_dyna
|
||||
: public dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag>
|
||||
{
|
||||
typedef boost::container::vector<
|
||||
std::pair<Box, dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag> *>,
|
||||
std::pair<Box, typename Allocators::node_pointer>,
|
||||
typename Allocators::internal_node_elements_allocator_type
|
||||
> elements_type;
|
||||
|
||||
@@ -85,39 +85,61 @@ struct visitor<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag, IsVis
|
||||
typedef dynamic_visitor<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag, IsVisitableConst> type;
|
||||
};
|
||||
|
||||
// element's indexable type
|
||||
|
||||
template <typename Value, typename Translator>
|
||||
struct element_indexable_type
|
||||
template <typename Element, typename Value, typename Translator>
|
||||
struct translator_wrapper_helper
|
||||
{
|
||||
typedef typename translator::indexable_type<Translator>::type type;
|
||||
typedef typename Element::first_type element_indexable_type;
|
||||
typedef typename Element::first_type const& element_indexable_result;
|
||||
};
|
||||
|
||||
template <typename Value, typename Parameters, typename Box, typename Allocators, typename Tag, typename Translator>
|
||||
struct element_indexable_type<
|
||||
std::pair<Box, dynamic_node<Value, Parameters, Box, Allocators, Tag> *>,
|
||||
Translator
|
||||
>
|
||||
template <typename Value, typename Translator>
|
||||
struct translator_wrapper_helper<Value, Value, Translator>
|
||||
{
|
||||
typedef Box type;
|
||||
typedef typename translator::indexable_type<Translator>::type element_indexable_type;
|
||||
typedef typename Translator::result_type element_indexable_result;
|
||||
};
|
||||
|
||||
template <typename Value, typename Translator, typename Tag>
|
||||
struct translator_wrapper
|
||||
: public Translator
|
||||
{
|
||||
translator_wrapper(Translator const& t = Translator()) : Translator(t) {}
|
||||
|
||||
template <typename Element>
|
||||
struct element_indexable_type
|
||||
{
|
||||
typedef typename translator_wrapper_helper<Element, Value, Translator>::element_indexable_type type;
|
||||
};
|
||||
|
||||
template <typename Element>
|
||||
struct element_indexable_result
|
||||
{
|
||||
typedef typename translator_wrapper_helper<Element, Value, Translator>::element_indexable_result type;
|
||||
};
|
||||
|
||||
typename element_indexable_result<Value>::type
|
||||
element_indexable(Value const& v) const { return Translator::operator()(v); }
|
||||
|
||||
template <typename Element>
|
||||
typename element_indexable_result<Element>::type
|
||||
element_indexable(Element const& el) const { return el.first; }
|
||||
};
|
||||
|
||||
// element's indexable type
|
||||
|
||||
template <typename Element, typename Translator>
|
||||
struct element_indexable_type
|
||||
{
|
||||
typedef typename Translator::template element_indexable_type<Element>::type type;
|
||||
};
|
||||
|
||||
// element's indexable getter
|
||||
|
||||
template <typename Value, typename Translator>
|
||||
inline typename Translator::result_type
|
||||
element_indexable(Value const& el, Translator const& tr)
|
||||
template <typename Element, typename Translator>
|
||||
typename Translator::template element_indexable_result<Element>::type
|
||||
element_indexable(Element const& el, Translator const& tr)
|
||||
{
|
||||
return tr(el);
|
||||
}
|
||||
|
||||
template <typename Value, typename Parameters, typename Box, typename Allocators, typename Tag, typename Translator>
|
||||
inline Box const&
|
||||
element_indexable(
|
||||
std::pair< Box, dynamic_node<Value, Parameters, Box, Allocators, Tag> *> const& el,
|
||||
Translator const&)
|
||||
{
|
||||
return el.first;
|
||||
return tr.element_indexable(el);
|
||||
}
|
||||
|
||||
// nodes elements
|
||||
@@ -161,6 +183,10 @@ public:
|
||||
typedef Allocator allocator_type;
|
||||
typedef typename allocator_type::size_type size_type;
|
||||
|
||||
typedef typename allocator_type::template rebind<
|
||||
typename node<Value, Parameters, Box, allocators, node_d_mem_dynamic_tag>::type
|
||||
>::other::pointer node_pointer;
|
||||
|
||||
typedef typename allocator_type::template rebind<
|
||||
typename internal_node<Value, Parameters, Box, allocators, node_d_mem_dynamic_tag>::type
|
||||
>::other internal_node_allocator_type;
|
||||
@@ -170,7 +196,7 @@ public:
|
||||
>::other leaf_allocator_type;
|
||||
|
||||
typedef typename allocator_type::template rebind<
|
||||
std::pair<Box, typename node<Value, Parameters, Box, allocators, node_d_mem_dynamic_tag>::type *>
|
||||
std::pair<Box, node_pointer>
|
||||
>::other internal_node_elements_allocator_type;
|
||||
|
||||
typedef typename allocator_type::template rebind<
|
||||
@@ -227,22 +253,25 @@ public:
|
||||
|
||||
// create_node_impl
|
||||
|
||||
template <typename BaseNode, typename Node>
|
||||
template <typename BaseNodePtr>
|
||||
struct create_dynamic_node
|
||||
{
|
||||
template <typename AllocNode, typename AllocElems>
|
||||
static inline BaseNode * apply(AllocNode & alloc_node, AllocElems & alloc_elems)
|
||||
static inline BaseNodePtr apply(AllocNode & alloc_node, AllocElems & alloc_elems)
|
||||
{
|
||||
Node * p = alloc_node.allocate(1);
|
||||
typedef typename AllocNode::pointer P;
|
||||
typedef typename AllocNode::value_type V;
|
||||
|
||||
P p = alloc_node.allocate(1);
|
||||
|
||||
if ( 0 == p )
|
||||
throw std::bad_alloc();
|
||||
throw std::bad_alloc(); // TODO throw different exception
|
||||
|
||||
try
|
||||
{
|
||||
// NOTE/TODO
|
||||
// Here the whole node may be copied
|
||||
alloc_node.construct(p, Node(alloc_elems));
|
||||
alloc_node.construct(p, V(alloc_elems));
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
@@ -256,13 +285,15 @@ struct create_dynamic_node
|
||||
|
||||
// destroy_node_impl
|
||||
|
||||
template <typename Node>
|
||||
struct destroy_dynamic_node
|
||||
{
|
||||
template <typename AllocNode, typename BaseNode>
|
||||
static inline void apply(AllocNode & alloc_node, BaseNode * n)
|
||||
template <typename AllocNode, typename BaseNodePtr>
|
||||
static inline void apply(AllocNode & alloc_node, BaseNodePtr n)
|
||||
{
|
||||
Node * p = rtree::get<Node>(n);
|
||||
typedef typename AllocNode::value_type V;
|
||||
typedef typename AllocNode::pointer P;
|
||||
|
||||
P p(&static_cast<V&>(rtree::get<V>(*n)));
|
||||
alloc_node.destroy(p);
|
||||
alloc_node.deallocate(p, 1);
|
||||
}
|
||||
@@ -276,12 +307,11 @@ struct create_node<
|
||||
dynamic_internal_node<Value, Parameters, Box, Allocators, Tag>
|
||||
>
|
||||
{
|
||||
static inline dynamic_node<Value, Parameters, Box, Allocators, Tag> *
|
||||
static inline typename Allocators::node_pointer
|
||||
apply(Allocators & allocators)
|
||||
{
|
||||
return create_dynamic_node<
|
||||
dynamic_node<Value, Parameters, Box, Allocators, Tag>,
|
||||
dynamic_internal_node<Value, Parameters, Box, Allocators, Tag>
|
||||
typename Allocators::node_pointer
|
||||
>::apply(allocators.internal_node_allocator, allocators.internal_node_elements_allocator);
|
||||
}
|
||||
};
|
||||
@@ -292,13 +322,12 @@ struct create_node<
|
||||
dynamic_leaf<Value, Parameters, Box, Allocators, Tag>
|
||||
>
|
||||
{
|
||||
static inline dynamic_node<Value, Parameters, Box, Allocators, Tag> *
|
||||
static inline typename Allocators::node_pointer
|
||||
apply(Allocators & allocators)
|
||||
{
|
||||
return create_dynamic_node<
|
||||
dynamic_node<Value, Parameters, Box, Allocators, Tag>,
|
||||
dynamic_leaf<Value, Parameters, Box, Allocators, Tag>
|
||||
>::template apply(allocators.leaf_allocator, allocators.leaf_elements_allocator);
|
||||
typename Allocators::node_pointer
|
||||
>::apply(allocators.leaf_allocator, allocators.leaf_elements_allocator);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -310,11 +339,9 @@ struct destroy_node<
|
||||
dynamic_internal_node<Value, Parameters, Box, Allocators, Tag>
|
||||
>
|
||||
{
|
||||
static inline void apply(Allocators & allocators, dynamic_node<Value, Parameters, Box, Allocators, Tag> * n)
|
||||
static inline void apply(Allocators & allocators, typename Allocators::node_pointer n)
|
||||
{
|
||||
destroy_dynamic_node<
|
||||
dynamic_internal_node<Value, Parameters, Box, Allocators, Tag>
|
||||
>::apply(allocators.internal_node_allocator, n);
|
||||
destroy_dynamic_node::apply(allocators.internal_node_allocator, n);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -324,11 +351,9 @@ struct destroy_node<
|
||||
dynamic_leaf<Value, Parameters, Box, Allocators, Tag>
|
||||
>
|
||||
{
|
||||
static inline void apply(Allocators & allocators, dynamic_node<Value, Parameters, Box, Allocators, Tag> * n)
|
||||
static inline void apply(Allocators & allocators, typename Allocators::node_pointer n)
|
||||
{
|
||||
destroy_dynamic_node<
|
||||
dynamic_leaf<Value, Parameters, Box, Allocators, Tag>
|
||||
>::apply(allocators.leaf_allocator, n);
|
||||
destroy_dynamic_node::apply(allocators.leaf_allocator, n);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ struct dynamic_internal_node<Value, Parameters, Box, Allocators, node_d_mem_stat
|
||||
typedef detail::varray<
|
||||
std::pair<
|
||||
Box,
|
||||
dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag> *
|
||||
typename Allocators::node_pointer
|
||||
>,
|
||||
Parameters::max_elements + 1,
|
||||
typename Allocators::internal_node_elements_allocator_type
|
||||
@@ -104,6 +104,10 @@ public:
|
||||
typedef Allocator allocator_type;
|
||||
typedef typename allocator_type::size_type size_type;
|
||||
|
||||
typedef typename allocator_type::template rebind<
|
||||
typename node<Value, Parameters, Box, allocators, node_d_mem_static_tag>::type
|
||||
>::other::pointer node_pointer;
|
||||
|
||||
typedef typename allocator_type::template rebind<
|
||||
typename internal_node<Value, Parameters, Box, allocators, node_d_mem_static_tag>::type
|
||||
>::other internal_node_allocator_type;
|
||||
@@ -113,7 +117,7 @@ public:
|
||||
>::other leaf_allocator_type;
|
||||
|
||||
typedef typename allocator_type::template rebind<
|
||||
std::pair<Box, typename node<Value, Parameters, Box, allocators, node_d_mem_static_tag>::type *>
|
||||
std::pair<Box, node_pointer>
|
||||
>::other internal_node_elements_allocator_type;
|
||||
|
||||
typedef typename allocator_type::template rebind<
|
||||
@@ -164,13 +168,12 @@ struct create_node<
|
||||
dynamic_internal_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag>
|
||||
>
|
||||
{
|
||||
static inline dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag> *
|
||||
static inline typename Allocators::node_pointer
|
||||
apply(Allocators & allocators)
|
||||
{
|
||||
return create_dynamic_node<
|
||||
dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag>,
|
||||
dynamic_internal_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag>
|
||||
>::template apply(allocators.internal_node_allocator, allocators.internal_node_allocator);
|
||||
typename Allocators::node_pointer
|
||||
>::apply(allocators.internal_node_allocator, allocators.internal_node_allocator);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -180,13 +183,12 @@ struct create_node<
|
||||
dynamic_leaf<Value, Parameters, Box, Allocators, node_d_mem_static_tag>
|
||||
>
|
||||
{
|
||||
static inline typename node<Value, Parameters, Box, Allocators, node_d_mem_static_tag>::type *
|
||||
static inline typename Allocators::node_pointer
|
||||
apply(Allocators & allocators)
|
||||
{
|
||||
return create_dynamic_node<
|
||||
dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag>,
|
||||
dynamic_leaf<Value, Parameters, Box, Allocators, node_d_mem_static_tag>
|
||||
>::template apply(allocators.leaf_allocator, allocators.leaf_allocator);
|
||||
typename Allocators::node_pointer
|
||||
>::apply(allocators.leaf_allocator, allocators.leaf_allocator);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -27,16 +27,18 @@ public:
|
||||
typedef typename rtree::internal_node<Value, typename Options::parameters_type, Box, Allocators, typename Options::node_tag>::type internal_node;
|
||||
typedef typename rtree::leaf<Value, typename Options::parameters_type, Box, Allocators, typename Options::node_tag>::type leaf;
|
||||
|
||||
inline destroy(node * root_node, Allocators & allocators)
|
||||
typedef typename Allocators::node_pointer node_pointer;
|
||||
|
||||
inline destroy(node_pointer root_node, Allocators & allocators)
|
||||
: m_current_node(root_node)
|
||||
, m_allocators(allocators)
|
||||
{}
|
||||
|
||||
inline void operator()(internal_node & n)
|
||||
{
|
||||
BOOST_GEOMETRY_INDEX_ASSERT(&n == rtree::get<internal_node>(m_current_node), "invalid pointers");
|
||||
BOOST_GEOMETRY_INDEX_ASSERT(&n == &rtree::get<internal_node>(*m_current_node), "invalid pointers");
|
||||
|
||||
node * node_to_destroy = m_current_node;
|
||||
node_pointer node_to_destroy = m_current_node;
|
||||
|
||||
typedef typename rtree::elements_type<internal_node>::type elements_type;
|
||||
elements_type & elements = rtree::elements(n);
|
||||
@@ -54,13 +56,13 @@ public:
|
||||
|
||||
inline void operator()(leaf & BOOST_GEOMETRY_INDEX_ASSERT_UNUSED_PARAM(l))
|
||||
{
|
||||
BOOST_GEOMETRY_INDEX_ASSERT(&l == rtree::get<leaf>(m_current_node), "invalid pointers");
|
||||
BOOST_GEOMETRY_INDEX_ASSERT(&l == &rtree::get<leaf>(*m_current_node), "invalid pointers");
|
||||
|
||||
rtree::destroy_node<Allocators, leaf>::apply(m_allocators, m_current_node);
|
||||
}
|
||||
|
||||
private:
|
||||
node * m_current_node;
|
||||
node_pointer m_current_node;
|
||||
Allocators & m_allocators;
|
||||
};
|
||||
|
||||
|
||||
@@ -120,7 +120,10 @@ protected:
|
||||
typedef rtree::node_auto_ptr<Value, Options, Translator, Box, Allocators> node_auto_ptr;
|
||||
|
||||
public:
|
||||
typedef index::detail::varray<std::pair<Box, node*>, 1> nodes_container_type;
|
||||
typedef index::detail::varray<
|
||||
typename rtree::elements_type<internal_node>::type::value_type,
|
||||
1
|
||||
> nodes_container_type;
|
||||
|
||||
template <typename Node>
|
||||
static inline void apply(nodes_container_type & additional_nodes,
|
||||
@@ -230,8 +233,9 @@ protected:
|
||||
typedef typename rtree::leaf<Value, parameters_type, Box, Allocators, typename Options::node_tag>::type leaf;
|
||||
|
||||
typedef rtree::node_auto_ptr<Value, Options, Translator, Box, Allocators> node_auto_ptr;
|
||||
typedef typename Allocators::node_pointer node_pointer;
|
||||
|
||||
inline insert(node* & root,
|
||||
inline insert(node_pointer & root,
|
||||
size_t & leafs_level,
|
||||
Element const& element,
|
||||
parameters_type const& parameters,
|
||||
@@ -278,7 +282,7 @@ protected:
|
||||
inline void post_traverse(Node &n)
|
||||
{
|
||||
BOOST_GEOMETRY_INDEX_ASSERT(m_traverse_data.current_is_root() ||
|
||||
&n == rtree::get<Node>(m_traverse_data.current_element().second),
|
||||
&n == &rtree::get<Node>(*m_traverse_data.current_element().second),
|
||||
"if node isn't the root current_child_index should be valid");
|
||||
|
||||
// handle overflow
|
||||
@@ -342,7 +346,7 @@ protected:
|
||||
// node is the root - add level
|
||||
else
|
||||
{
|
||||
BOOST_GEOMETRY_INDEX_ASSERT(&n == rtree::get<Node>(m_root_node), "node should be the root");
|
||||
BOOST_GEOMETRY_INDEX_ASSERT(&n == &rtree::get<Node>(*m_root_node), "node should be the root");
|
||||
|
||||
// create new root and add nodes
|
||||
node_auto_ptr new_root(rtree::create_node<Allocators, internal_node>::apply(m_allocators), m_allocators); // MAY THROW, STRONG (N:alloc)
|
||||
@@ -373,7 +377,7 @@ protected:
|
||||
const size_t m_relative_level;
|
||||
const size_t m_level;
|
||||
|
||||
node* & m_root_node;
|
||||
node_pointer & m_root_node;
|
||||
size_t & m_leafs_level;
|
||||
|
||||
// traversing input parameters
|
||||
@@ -403,8 +407,9 @@ public:
|
||||
typedef typename base::leaf leaf;
|
||||
|
||||
typedef typename Options::parameters_type parameters_type;
|
||||
typedef typename base::node_pointer node_pointer;
|
||||
|
||||
inline insert(node* & root,
|
||||
inline insert(node_pointer & root,
|
||||
size_t & leafs_level,
|
||||
Element & element,
|
||||
parameters_type const& parameters,
|
||||
@@ -465,8 +470,9 @@ public:
|
||||
typedef typename base::leaf leaf;
|
||||
|
||||
typedef typename Options::parameters_type parameters_type;
|
||||
typedef typename base::node_pointer node_pointer;
|
||||
|
||||
inline insert(node* & root,
|
||||
inline insert(node_pointer & root,
|
||||
size_t & leafs_level,
|
||||
Value const& value,
|
||||
parameters_type const& parameters,
|
||||
|
||||
@@ -201,7 +201,7 @@ public:
|
||||
// array of active nodes
|
||||
typename index::detail::rtree::container_from_elements_type<
|
||||
elements_type,
|
||||
std::pair<node_distances_type, const node *>
|
||||
std::pair<node_distances_type, typename Allocators::node_pointer>
|
||||
>::type active_branch_list;
|
||||
active_branch_list.reserve(m_parameters.get_max_elements());
|
||||
|
||||
@@ -311,8 +311,8 @@ private:
|
||||
}
|
||||
|
||||
static inline bool abl_less(
|
||||
std::pair<node_distances_type, const node *> const& p1,
|
||||
std::pair<node_distances_type, const node *> const& p2)
|
||||
std::pair<node_distances_type, typename Allocators::node_pointer> const& p1,
|
||||
std::pair<node_distances_type, typename Allocators::node_pointer> const& p2)
|
||||
{
|
||||
return index::detail::cdist_value<node_distances_type>
|
||||
::template get<index::detail::to_nearest_tag>(p1.first)
|
||||
|
||||
@@ -130,7 +130,11 @@ private:
|
||||
typedef typename detail::rtree::internal_node<value_type, typename options_type::parameters_type, box_type, allocators_type, node_tag>::type internal_node;
|
||||
typedef typename detail::rtree::leaf<value_type, typename options_type::parameters_type, box_type, allocators_type, node_tag>::type leaf;
|
||||
|
||||
typedef detail::rtree::translator_wrapper<Value, Translator, node_tag> translator_wrapper;
|
||||
typedef typename allocators_type::node_pointer node_pointer;
|
||||
|
||||
public:
|
||||
|
||||
/*!
|
||||
\brief The constructor.
|
||||
|
||||
@@ -782,7 +786,7 @@ public:
|
||||
if ( !m_root )
|
||||
return 0;
|
||||
|
||||
detail::rtree::visitors::count<ValueOrIndexable, value_type, options_type, translator_type, box_type, allocators_type>
|
||||
detail::rtree::visitors::count<ValueOrIndexable, value_type, options_type, translator_wrapper, box_type, allocators_type>
|
||||
count_v(vori, m_translator);
|
||||
|
||||
detail::rtree::apply_visitor(count_v, *m_root);
|
||||
@@ -900,7 +904,7 @@ private:
|
||||
|
||||
detail::rtree::visitors::insert<
|
||||
value_type,
|
||||
value_type, options_type, translator_type, box_type, allocators_type,
|
||||
value_type, options_type, translator_wrapper, box_type, allocators_type,
|
||||
typename options_type::insert_tag
|
||||
> insert_v(m_root, m_leafs_level, value, m_parameters, m_translator, m_allocators);
|
||||
|
||||
@@ -929,7 +933,7 @@ private:
|
||||
BOOST_GEOMETRY_INDEX_ASSERT(m_root, "The root must exist");
|
||||
|
||||
detail::rtree::visitors::remove<
|
||||
value_type, options_type, translator_type, box_type, allocators_type
|
||||
value_type, options_type, translator_wrapper, box_type, allocators_type
|
||||
> remove_v(m_root, m_leafs_level, m_box, value, m_parameters, m_translator, m_allocators);
|
||||
|
||||
detail::rtree::apply_visitor(remove_v, *m_root);
|
||||
@@ -975,7 +979,7 @@ private:
|
||||
{
|
||||
if ( t.m_root )
|
||||
{
|
||||
detail::rtree::visitors::destroy<value_type, options_type, translator_type, box_type, allocators_type> del_v(t.m_root, t.m_allocators);
|
||||
detail::rtree::visitors::destroy<value_type, options_type, translator_wrapper, box_type, allocators_type> del_v(t.m_root, t.m_allocators);
|
||||
detail::rtree::apply_visitor(del_v, *t.m_root);
|
||||
|
||||
t.m_root = 0;
|
||||
@@ -996,7 +1000,7 @@ private:
|
||||
*/
|
||||
inline void raw_copy(rtree const& src, rtree & dst, bool copy_all_internals) const
|
||||
{
|
||||
detail::rtree::visitors::copy<value_type, options_type, translator_type, box_type, allocators_type> copy_v(dst.m_allocators);
|
||||
detail::rtree::visitors::copy<value_type, options_type, translator_wrapper, box_type, allocators_type> copy_v(dst.m_allocators);
|
||||
|
||||
if ( src.m_root )
|
||||
detail::rtree::apply_visitor(copy_v, *src.m_root); // MAY THROW (V, E: alloc, copy, N: alloc)
|
||||
@@ -1011,7 +1015,7 @@ private:
|
||||
|
||||
if ( dst.m_root )
|
||||
{
|
||||
detail::rtree::visitors::destroy<value_type, options_type, translator_type, box_type, allocators_type> del_v(dst.m_root, dst.m_allocators);
|
||||
detail::rtree::visitors::destroy<value_type, options_type, translator_wrapper, box_type, allocators_type> del_v(dst.m_root, dst.m_allocators);
|
||||
detail::rtree::apply_visitor(del_v, *dst.m_root);
|
||||
dst.m_root = 0;
|
||||
}
|
||||
@@ -1030,7 +1034,7 @@ private:
|
||||
template <typename Predicates, typename OutIter>
|
||||
size_type query_dispatch(Predicates const& predicates, OutIter out_it, boost::mpl::bool_<false> const& /*is_nearest*/) const
|
||||
{
|
||||
detail::rtree::visitors::spatial_query<value_type, options_type, translator_type, box_type, allocators_type, Predicates, OutIter>
|
||||
detail::rtree::visitors::spatial_query<value_type, options_type, translator_wrapper, box_type, allocators_type, Predicates, OutIter>
|
||||
find_v(m_translator, predicates, out_it);
|
||||
|
||||
detail::rtree::apply_visitor(find_v, *m_root);
|
||||
@@ -1068,7 +1072,7 @@ private:
|
||||
|
||||
typedef detail::rtree::visitors::nearest_query_result_k<
|
||||
value_type,
|
||||
translator_type,
|
||||
translator_wrapper,
|
||||
point_type,
|
||||
OutIter
|
||||
> result_type;
|
||||
@@ -1078,7 +1082,7 @@ private:
|
||||
detail::rtree::visitors::nearest_query<
|
||||
value_type,
|
||||
options_type,
|
||||
translator_type,
|
||||
translator_wrapper,
|
||||
box_type,
|
||||
allocators_type,
|
||||
DistancesPredicates,
|
||||
@@ -1091,13 +1095,13 @@ private:
|
||||
return result.finish();
|
||||
}
|
||||
|
||||
translator_type m_translator;
|
||||
translator_wrapper m_translator;
|
||||
Parameters m_parameters;
|
||||
allocators_type m_allocators;
|
||||
|
||||
size_type m_values_count;
|
||||
size_type m_leafs_level;
|
||||
node * m_root;
|
||||
node_pointer m_root;
|
||||
|
||||
box_type m_box;
|
||||
};
|
||||
|
||||
@@ -62,9 +62,9 @@ int test_main(int, char* [])
|
||||
typedef bg::model::box<P2d> B2d;
|
||||
typedef std::pair<B2d, int> PB2d;
|
||||
|
||||
test_rtree_interprocess<P2d>(bgi::linear<32, 8>());
|
||||
/*test_rtree_interprocess<P2d>(bgi::runtime::linear(32, 8));
|
||||
test_rtree_interprocess<B2d>(bgi::quadratic<32, 8>());
|
||||
//test_rtree_interprocess<P2d>(bgi::linear<32, 8>());
|
||||
test_rtree_interprocess<P2d>(bgi::runtime::linear(32, 8));
|
||||
/*test_rtree_interprocess<B2d>(bgi::quadratic<32, 8>());
|
||||
test_rtree_interprocess<B2d>(bgi::runtime::quadratic(32, 8));
|
||||
test_rtree_interprocess<PB2d>(bgi::rstar<32, 8>());
|
||||
test_rtree_interprocess<PB2d>(bgi::runtime::rstar(32, 8));
|
||||
|
||||
Reference in New Issue
Block a user