Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80752 - sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node
From: adam.wulkiewicz_at_[hidden]
Date: 2012-09-29 07:44:22


Author: awulkiew
Date: 2012-09-29 07:44:21 EDT (Sat, 29 Sep 2012)
New Revision: 80752
URL: http://svn.boost.org/trac/boost/changeset/80752

Log:
renamed node types files
Added:
   sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node_d_mem_dynamic.hpp
      - copied unchanged from r80751, /sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node_default.hpp
   sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node_d_mem_static.hpp
      - copied unchanged from r80751, /sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node_default_static.hpp
   sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node_s_mem_dynamic.hpp
      - copied unchanged from r80751, /sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node_default_variant.hpp
   sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node_s_mem_static.hpp
      - copied unchanged from r80751, /sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node_default_static_variant.hpp
Removed:
   sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node_default.hpp
   sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node_default_static.hpp
   sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node_default_static_variant.hpp
   sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node_default_variant.hpp
Text files modified:
   sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node.hpp | 9 ++++-----
   1 files changed, 4 insertions(+), 5 deletions(-)

Modified: sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node.hpp
==============================================================================
--- sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node.hpp (original)
+++ sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node.hpp 2012-09-29 07:44:21 EDT (Sat, 29 Sep 2012)
@@ -13,11 +13,10 @@
 
 #include <boost/geometry/extensions/index/rtree/node/concept.hpp>
 
-#include <boost/geometry/extensions/index/rtree/node/node_default.hpp>
-#include <boost/geometry/extensions/index/rtree/node/node_default_variant.hpp>
-
-#include <boost/geometry/extensions/index/rtree/node/node_default_static.hpp>
-#include <boost/geometry/extensions/index/rtree/node/node_default_static_variant.hpp>
+#include <boost/geometry/extensions/index/rtree/node/node_d_mem_dynamic.hpp>
+#include <boost/geometry/extensions/index/rtree/node/node_s_mem_dynamic.hpp>
+#include <boost/geometry/extensions/index/rtree/node/node_d_mem_static.hpp>
+#include <boost/geometry/extensions/index/rtree/node/node_s_mem_static.hpp>
 
 #include <boost/geometry/algorithms/expand.hpp>
 

Deleted: sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node_default.hpp
==============================================================================
--- sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node_default.hpp 2012-09-29 07:44:21 EDT (Sat, 29 Sep 2012)
+++ (empty file)
@@ -1,324 +0,0 @@
-// Boost.Geometry Index
-//
-// R-tree nodes based on run-time polymorphism, storing std::vectors
-//
-// Copyright (c) 2011-2012 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
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_NODE_NODE_DEFAULT_HPP
-#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_NODE_NODE_DEFAULT_HPP
-
-#include <vector>
-
-#include <boost/geometry/extensions/index/rtree/node/dynamic_visitor.hpp>
-
-namespace boost { namespace geometry { namespace index {
-
-namespace detail { namespace rtree {
-
-template <typename Value, typename Parameters, typename Box, typename Allocators>
-struct dynamic_internal_node<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag>
- : public dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag>
-{
- typedef std::vector<
- std::pair<Box, dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag> *>,
- typename Allocators::internal_node_elements_allocator_type
- > elements_type;
-
- inline dynamic_internal_node(typename Allocators::internal_node_elements_allocator_type & al)
- : elements(al)
- {}
-
- void apply_visitor(dynamic_visitor<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag, false> & v) { v(*this); }
- void apply_visitor(dynamic_visitor<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag, true> & v) const { v(*this); }
-
- elements_type elements;
-};
-
-template <typename Value, typename Parameters, typename Box, typename Allocators>
-struct dynamic_leaf<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag>
- : public dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag>
-{
- typedef std::vector<
- Value,
- typename Allocators::leaf_elements_allocator_type
- > elements_type;
-
- inline dynamic_leaf(typename Allocators::leaf_elements_allocator_type & al)
- : elements(al)
- {}
-
- void apply_visitor(dynamic_visitor<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag, false> & v) { v(*this); }
- void apply_visitor(dynamic_visitor<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag, true> & v) const { v(*this); }
-
- elements_type elements;
-};
-
-// nodes traits
-
-template <typename Value, typename Parameters, typename Box, typename Allocators>
-struct node<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag>
-{
- typedef dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag> type;
-};
-
-template <typename Value, typename Parameters, typename Box, typename Allocators>
-struct internal_node<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag>
-{
- typedef dynamic_internal_node<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag> type;
-};
-
-template <typename Value, typename Parameters, typename Box, typename Allocators>
-struct leaf<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag>
-{
- typedef dynamic_leaf<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag> type;
-};
-
-// nodes conversion
-
-template <typename Derived, typename Parameters, typename Value, typename Box, typename Allocators, typename Tag>
-inline Derived & get(dynamic_node<Value, Parameters, Box, Allocators, Tag> & n)
-{
- assert(dynamic_cast<Derived*>(&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)
-{
- assert(dynamic_cast<Derived*>(n));
- return static_cast<Derived*>(n);
-}
-
-// visitor traits
-
-template <typename Value, typename Parameters, typename Box, typename Allocators, bool IsVisitableConst>
-struct visitor<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag, IsVisitableConst>
-{
- typedef dynamic_visitor<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag, IsVisitableConst> type;
-};
-
-template <typename Visitor, typename Visitable>
-inline void apply_visitor(Visitor &v, Visitable & n)
-{
- n.apply_visitor(v);
-}
-
-// element's indexable type
-
-template <typename Value, typename Translator>
-struct element_indexable_type
-{
- typedef typename translator::indexable_type<Translator>::type type;
-};
-
-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
->
-{
- typedef Box type;
-};
-
-// element's indexable getter
-
-template <typename Value, typename Translator>
-inline typename Translator::result_type
-element_indexable(Value 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;
-}
-
-// nodes elements
-
-template <typename Node>
-struct elements_type
-{
- typedef typename Node::elements_type type;
-};
-
-template <typename Node>
-inline typename elements_type<Node>::type &
-elements(Node & n)
-{
- return n.elements;
-}
-
-template <typename Node>
-inline typename elements_type<Node>::type const&
-elements(Node const& n)
-{
- return n.elements;
-}
-
-// elements derived type
-template <typename Elements, typename NewValue>
-struct container_from_elements_type
-{
- typedef std::vector<NewValue> type;
-};
-
-// allocators
-
-template <typename Allocator, typename Value, typename Parameters, typename Box>
-struct allocators<Allocator, Value, Parameters, Box, node_d_mem_dynamic_tag>
-{
- typedef Allocator allocator_type;
- typedef typename allocator_type::size_type size_type;
-
- typedef typename allocator_type::template rebind<
- typename internal_node<Value, Parameters, Box, allocators, node_d_mem_dynamic_tag>::type
- >::other internal_node_allocator_type;
-
- typedef typename allocator_type::template rebind<
- typename leaf<Value, Parameters, Box, allocators, node_d_mem_dynamic_tag>::type
- >::other leaf_allocator_type;
-
- typedef typename allocator_type::template rebind<
- std::pair<Box, dynamic_node<Value, Parameters, Box, allocators, node_d_mem_dynamic_tag> *>
- >::other internal_node_elements_allocator_type;
-
- typedef typename allocator_type::template rebind<
- Value
- >::other leaf_elements_allocator_type;
-
- inline explicit allocators(Allocator alloc)
- : allocator(alloc)
- , internal_node_allocator(allocator)
- , leaf_allocator(allocator)
- , internal_node_elements_allocator(allocator)
- , leaf_elements_allocator(allocator)
- {}
-
- allocator_type allocator;
- internal_node_allocator_type internal_node_allocator;
- leaf_allocator_type leaf_allocator;
- internal_node_elements_allocator_type internal_node_elements_allocator;
- leaf_elements_allocator_type leaf_elements_allocator;
-};
-
-// create_node_impl
-
-template <typename Node>
-struct create_node_poly
-{
- template <typename RetNode, typename AllocNode, typename AllocElems>
- static inline RetNode * apply(AllocNode & alloc_node, AllocElems & alloc_elems)
- {
- Node * p = alloc_node.allocate(1);
-
- if ( 0 == p )
- throw std::bad_alloc();
-
- try
- {
- alloc_node.construct(p, Node(alloc_elems));
- }
- catch(...)
- {
- alloc_node.deallocate(p, 1);
- throw;
- }
-
- return p;
- }
-};
-
-// destroy_node_impl
-
-template <typename Node>
-struct destroy_node_poly
-{
- template <typename AllocNode, typename BaseNode>
- static inline void apply(AllocNode & alloc_node, BaseNode * n)
- {
- Node * p = rtree::get<Node>(n);
- alloc_node.destroy(p);
- alloc_node.deallocate(p, 1);
- }
-};
-
-// create_node
-
-template <typename Allocators, typename Value, typename Parameters, typename Box, typename Tag>
-struct create_node<
- Allocators,
- dynamic_internal_node<Value, Parameters, Box, Allocators, Tag>
->
-{
- static inline typename node<Value, Parameters, Box, Allocators, Tag>::type *
- apply(Allocators & allocators)
- {
- return create_node_poly<
- dynamic_internal_node<Value, Parameters, Box, Allocators, Tag>
- >::template apply<
- typename node<Value, Parameters, Box, Allocators, Tag>::type
- >(allocators.internal_node_allocator, allocators.internal_node_elements_allocator);
- }
-};
-
-template <typename Allocators, typename Value, typename Parameters, typename Box, typename Tag>
-struct create_node<
- Allocators,
- dynamic_leaf<Value, Parameters, Box, Allocators, Tag>
->
-{
- static inline typename node<Value, Parameters, Box, Allocators, Tag>::type *
- apply(Allocators & allocators)
- {
- return create_node_poly<
- dynamic_leaf<Value, Parameters, Box, Allocators, Tag>
- >::template apply<
- typename node<Value, Parameters, Box, Allocators, Tag>::type
- >(allocators.leaf_allocator, allocators.leaf_elements_allocator);
- }
-};
-
-// destroy_node
-
-template <typename Allocators, typename Value, typename Parameters, typename Box, typename Tag>
-struct destroy_node<
- Allocators,
- dynamic_internal_node<Value, Parameters, Box, Allocators, Tag>
->
-{
- static inline void apply(Allocators & allocators, typename node<Value, Parameters, Box, Allocators, Tag>::type * n)
- {
- destroy_node_poly<
- dynamic_internal_node<Value, Parameters, Box, Allocators, Tag>
- >::apply(allocators.internal_node_allocator, n);
- }
-};
-
-template <typename Allocators, typename Value, typename Parameters, typename Box, typename Tag>
-struct destroy_node<
- Allocators,
- dynamic_leaf<Value, Parameters, Box, Allocators, Tag>
->
-{
- static inline void apply(Allocators & allocators, typename node<Value, Parameters, Box, Allocators, Tag>::type * n)
- {
- destroy_node_poly<
- dynamic_leaf<Value, Parameters, Box, Allocators, Tag>
- >::apply(allocators.leaf_allocator, n);
- }
-};
-
-}} // namespace detail::rtree
-
-}}} // namespace boost::geometry::index
-
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_NODE_NODE_DEFAULT_HPP

Deleted: sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node_default_static.hpp
==============================================================================
--- sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node_default_static.hpp 2012-09-29 07:44:21 EDT (Sat, 29 Sep 2012)
+++ (empty file)
@@ -1,157 +0,0 @@
-// Boost.Geometry Index
-//
-// R-tree nodes based on runtime-polymorphism, storing static-size containers
-//
-// Copyright (c) 2011-2012 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
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_NODE_NODE_DEFAULT_STATIC_HPP
-#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_NODE_NODE_DEFAULT_STATIC_HPP
-
-#include <boost/geometry/extensions/index/rtree/node/dynamic_visitor.hpp>
-#include <boost/geometry/extensions/index/pushable_array.hpp>
-
-namespace boost { namespace geometry { namespace index {
-
-namespace detail { namespace rtree {
-
-template <typename Value, typename Parameters, typename Box, typename Allocators>
-struct dynamic_internal_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag>
- : public dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag>
-{
- typedef index::pushable_array<
- std::pair<
- Box,
- dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag> *
- >,
- Parameters::max_elements + 1
- > elements_type;
-
- template <typename Dummy>
- inline dynamic_internal_node(Dummy) {}
-
- void apply_visitor(dynamic_visitor<Value, Parameters, Box, Allocators, node_d_mem_static_tag, false> & v) { v(*this); }
- void apply_visitor(dynamic_visitor<Value, Parameters, Box, Allocators, node_d_mem_static_tag, true> & v) const { v(*this); }
-
- elements_type elements;
-};
-
-template <typename Value, typename Parameters, typename Box, typename Allocators>
-struct dynamic_leaf<Value, Parameters, Box, Allocators, node_d_mem_static_tag>
- : public dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag>
-{
- typedef index::pushable_array<Value, Parameters::max_elements + 1> elements_type;
-
- template <typename Dummy>
- inline dynamic_leaf(Dummy) {}
-
- void apply_visitor(dynamic_visitor<Value, Parameters, Box, Allocators, node_d_mem_static_tag, false> & v) { v(*this); }
- void apply_visitor(dynamic_visitor<Value, Parameters, Box, Allocators, node_d_mem_static_tag, true> & v) const { v(*this); }
-
- elements_type elements;
-};
-
-// nodes traits
-
-template <typename Value, typename Parameters, typename Box, typename Allocators>
-struct node<Value, Parameters, Box, Allocators, node_d_mem_static_tag>
-{
- typedef dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag> type;
-};
-
-template <typename Value, typename Parameters, typename Box, typename Allocators>
-struct internal_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag>
-{
- typedef dynamic_internal_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag> type;
-};
-
-template <typename Value, typename Parameters, typename Box, typename Allocators>
-struct leaf<Value, Parameters, Box, Allocators, node_d_mem_static_tag>
-{
- typedef dynamic_leaf<Value, Parameters, Box, Allocators, node_d_mem_static_tag> type;
-};
-
-template <typename Value, typename Parameters, typename Box, typename Allocators, bool IsVisitableConst>
-struct visitor<Value, Parameters, Box, Allocators, node_d_mem_static_tag, IsVisitableConst>
-{
- typedef dynamic_visitor<Value, Parameters, Box, Allocators, node_d_mem_static_tag, IsVisitableConst> type;
-};
-
-// elements derived type
-template <typename OldValue, size_t N, typename NewValue>
-struct container_from_elements_type<index::pushable_array<OldValue, N>, NewValue>
-{
- typedef index::pushable_array<NewValue, N> type;
-};
-
-// allocators
-
-template <typename Allocator, typename Value, typename Parameters, typename Box>
-struct allocators<Allocator, Value, Parameters, Box, node_d_mem_static_tag>
-{
- typedef Allocator allocator_type;
- typedef typename allocator_type::size_type size_type;
-
- typedef typename allocator_type::template rebind<
- typename internal_node<Value, Parameters, Box, allocators, node_d_mem_static_tag>::type
- >::other internal_node_allocator_type;
-
- typedef typename allocator_type::template rebind<
- typename leaf<Value, Parameters, Box, allocators, node_d_mem_static_tag>::type
- >::other leaf_allocator_type;
-
- inline explicit allocators(Allocator alloc)
- : allocator(alloc)
- , internal_node_allocator(allocator)
- , leaf_allocator(allocator)
- {}
-
- allocator_type allocator;
- internal_node_allocator_type internal_node_allocator;
- leaf_allocator_type leaf_allocator;
-};
-
-// create_node
-
-template <typename Allocators, typename Value, typename Parameters, typename Box>
-struct create_node<
- Allocators,
- dynamic_internal_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag>
->
-{
- static inline typename node<Value, Parameters, Box, Allocators, node_d_mem_static_tag>::type *
- apply(Allocators & allocators)
- {
- return create_node_poly<
- dynamic_internal_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag>
- >::template apply<
- typename node<Value, Parameters, Box, Allocators, node_d_mem_static_tag>::type
- >(allocators.internal_node_allocator, allocators.internal_node_allocator);
- }
-};
-
-template <typename Allocators, typename Value, typename Parameters, typename Box>
-struct create_node<
- Allocators,
- 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 *
- apply(Allocators & allocators)
- {
- return create_node_poly<
- dynamic_leaf<Value, Parameters, Box, Allocators, node_d_mem_static_tag>
- >::template apply<
- typename node<Value, Parameters, Box, Allocators, node_d_mem_static_tag>::type
- >(allocators.leaf_allocator, allocators.leaf_allocator);
- }
-};
-
-}} // namespace detail::rtree
-
-}}} // namespace boost::geometry::index
-
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_NODE_NODE_DEFAULT_STATIC_HPP

Deleted: sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node_default_static_variant.hpp
==============================================================================
--- sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node_default_static_variant.hpp 2012-09-29 07:44:21 EDT (Sat, 29 Sep 2012)
+++ (empty file)
@@ -1,151 +0,0 @@
-// Boost.Geometry Index
-//
-// R-tree nodes based on Boost.Variant, storing static-size containers
-//
-// Copyright (c) 2011-2012 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
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_NODE_NODE_DEFAULT_STATIC_VARIANT_HPP
-#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_NODE_NODE_DEFAULT_STATIC_VARIANT_HPP
-
-#include <vector>
-#include <boost/variant.hpp>
-
-namespace boost { namespace geometry { namespace index {
-
-namespace detail { namespace rtree {
-
-// nodes default types
-
-template <typename Value, typename Parameters, typename Box, typename Allocators>
-struct internal_node_variant<Value, Parameters, Box, Allocators, node_s_mem_static_tag>
-{
- typedef index::pushable_array<
- std::pair<
- Box,
- typename node<Value, Parameters, Box, Allocators, node_s_mem_static_tag>::type *
- >,
- Parameters::max_elements + 1
- > elements_type;
-
- template <typename Dummy>
- inline internal_node_variant(Dummy) {}
-
- elements_type elements;
-};
-
-template <typename Value, typename Parameters, typename Box, typename Allocators>
-struct leaf_variant<Value, Parameters, Box, Allocators, node_s_mem_static_tag>
-{
- typedef index::pushable_array<Value, Parameters::max_elements + 1> elements_type;
-
- template <typename Dummy>
- inline leaf_variant(Dummy) {}
-
- elements_type elements;
-};
-
-// nodes traits
-
-template <typename Value, typename Parameters, typename Box, typename Allocators>
-struct node<Value, Parameters, Box, Allocators, node_s_mem_static_tag>
-{
- typedef boost::variant<
- leaf_variant<Value, Parameters, Box, Allocators, node_s_mem_static_tag>,
- internal_node_variant<Value, Parameters, Box, Allocators, node_s_mem_static_tag>
- > type;
-};
-
-template <typename Value, typename Parameters, typename Box, typename Allocators>
-struct internal_node<Value, Parameters, Box, Allocators, node_s_mem_static_tag>
-{
- typedef internal_node_variant<Value, Parameters, Box, Allocators, node_s_mem_static_tag> type;
-};
-
-template <typename Value, typename Parameters, typename Box, typename Allocators>
-struct leaf<Value, Parameters, Box, Allocators, node_s_mem_static_tag>
-{
- typedef leaf_variant<Value, Parameters, Box, Allocators, node_s_mem_static_tag> type;
-};
-
-// visitor traits
-
-template <typename Value, typename Parameters, typename Box, typename Allocators, bool IsVisitableConst>
-struct visitor<Value, Parameters, Box, Allocators, node_s_mem_static_tag, IsVisitableConst>
-{
- typedef static_visitor<> type;
-};
-
-// allocators
-
-template <typename Allocator, typename Value, typename Parameters, typename Box>
-struct allocators<Allocator, Value, Parameters, Box, node_s_mem_static_tag>
-{
- 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_s_mem_static_tag>::type
- >::other node_allocator_type;
-
- typedef typename allocator_type::template rebind<
- std::pair<Box, typename node<Value, Parameters, Box, allocators, node_s_mem_static_tag>::type *>
- >::other internal_node_elements_allocator_type;
-
- typedef typename allocator_type::template rebind<
- Value
- >::other leaf_elements_allocator_type;
-
- inline explicit allocators(Allocator alloc)
- : allocator(alloc)
- , node_allocator(allocator)
- {}
-
- allocator_type allocator;
- node_allocator_type node_allocator;
-};
-
-// create_node
-
-template <typename Allocators, typename Value, typename Parameters, typename Box>
-struct create_node<
- Allocators,
- internal_node_variant<Value, Parameters, Box, Allocators, node_s_mem_static_tag>
->
-{
- static inline typename node<Value, Parameters, Box, Allocators, node_s_mem_static_tag>::type *
- apply(Allocators & allocators)
- {
- return create_node_variant<
- internal_node_variant<Value, Parameters, Box, Allocators, node_s_mem_static_tag>
- >::template apply<
- typename node<Value, Parameters, Box, Allocators, node_s_mem_static_tag>::type
- >(allocators.node_allocator, allocators.node_allocator);
- }
-};
-
-template <typename Allocators, typename Value, typename Parameters, typename Box>
-struct create_node<
- Allocators,
- leaf_variant<Value, Parameters, Box, Allocators, node_s_mem_static_tag>
->
-{
- static inline typename node<Value, Parameters, Box, Allocators, node_s_mem_static_tag>::type *
- apply(Allocators & allocators)
- {
- return create_node_variant<
- leaf_variant<Value, Parameters, Box, Allocators, node_s_mem_static_tag>
- >::template apply<
- typename node<Value, Parameters, Box, Allocators, node_s_mem_static_tag>::type
- >(allocators.node_allocator, allocators.node_allocator);
- }
-};
-
-}} // namespace detail::rtree
-
-}}} // namespace boost::geometry::index
-
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_NODE_NODE_DEFAULT_STATIC_VARIANT_HPP

Deleted: sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node_default_variant.hpp
==============================================================================
--- sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/node/node_default_variant.hpp 2012-09-29 07:44:21 EDT (Sat, 29 Sep 2012)
+++ (empty file)
@@ -1,307 +0,0 @@
-// Boost.Geometry Index
-//
-// R-tree nodes based on Boost.Variant, storing std::vectors
-//
-// Copyright (c) 2011-2012 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
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_NODE_NODE_DEFAULT_VARIANT_HPP
-#define BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_NODE_NODE_DEFAULT_VARIANT_HPP
-
-#include <vector>
-#include <boost/variant.hpp>
-
-namespace boost { namespace geometry { namespace index {
-
-namespace detail { namespace rtree {
-
-// nodes default types
-
-template <typename Value, typename Parameters, typename Box, typename Allocators, typename Tag>
-struct internal_node_variant
-{
- typedef std::vector<
- std::pair<
- Box,
- typename node<Value, Parameters, Box, Allocators, Tag>::type *
- >,
- typename Allocators::internal_node_elements_allocator_type
- > elements_type;
-
- inline internal_node_variant(typename Allocators::internal_node_elements_allocator_type & al)
- : elements(al)
- {}
-
- elements_type elements;
-};
-
-template <typename Value, typename Parameters, typename Box, typename Allocators, typename Tag>
-struct leaf_variant
-{
- typedef std::vector<
- Value,
- typename Allocators::leaf_elements_allocator_type
- > elements_type;
-
- inline leaf_variant(typename Allocators::leaf_elements_allocator_type & al)
- : elements(al)
- {}
-
- elements_type elements;
-};
-
-// nodes traits
-
-template <typename Value, typename Parameters, typename Box, typename Allocators>
-struct node<Value, Parameters, Box, Allocators, node_s_mem_dynamic_tag>
-{
- typedef boost::variant<
- leaf_variant<Value, Parameters, Box, Allocators, node_s_mem_dynamic_tag>,
- internal_node_variant<Value, Parameters, Box, Allocators, node_s_mem_dynamic_tag>
- > type;
-};
-
-template <typename Value, typename Parameters, typename Box, typename Allocators>
-struct internal_node<Value, Parameters, Box, Allocators, node_s_mem_dynamic_tag>
-{
- typedef internal_node_variant<Value, Parameters, Box, Allocators, node_s_mem_dynamic_tag> type;
-};
-
-template <typename Value, typename Parameters, typename Box, typename Allocators>
-struct leaf<Value, Parameters, Box, Allocators, node_s_mem_dynamic_tag>
-{
- typedef leaf_variant<Value, Parameters, Box, Allocators, node_s_mem_dynamic_tag> type;
-};
-
-// nodes conversion
-
-template <typename V, typename Value, typename Parameters, typename Box, typename Allocators, typename Tag>
-inline V & get(
- boost::variant<
- leaf_variant<Value, Parameters, Box, Allocators, Tag>,
- internal_node_variant<Value, Parameters, Box, Allocators, Tag>
- > &v
-)
-{
- return boost::get<V>(v);
-}
-
-template <typename V, typename Value, typename Parameters, typename Box, typename Allocators, typename Tag>
-inline V * get(
- boost::variant<
- leaf_variant<Value, Parameters, Box, Allocators, Tag>,
- internal_node_variant<Value, Parameters, Box, Allocators, Tag>
- > *v
-)
-{
- return boost::get<V>(v);
-}
-
-// visitor traits
-
-template <typename Value, typename Parameters, typename Box, typename Allocators, bool IsVisitableConst>
-struct visitor<Value, Parameters, Box, Allocators, node_s_mem_dynamic_tag, IsVisitableConst>
-{
- typedef static_visitor<> type;
-};
-
-template <typename Visitor, typename Value, typename Parameters, typename Box, typename Allocators, typename Tag>
-inline void apply_visitor(Visitor & v,
- boost::variant<
- leaf_variant<Value, Parameters, Box, Allocators, Tag>,
- internal_node_variant<Value, Parameters, Box, Allocators, Tag>
- > & n)
-{
- boost::apply_visitor(v, n);
-}
-
-template <typename Visitor, typename Value, typename Parameters, typename Box, typename Allocators, typename Tag>
-inline void apply_visitor(Visitor & v,
- boost::variant<
- leaf_variant<Value, Parameters, Box, Allocators, Tag>,
- internal_node_variant<Value, Parameters, Box, Allocators, Tag>
- > const& n)
-{
- boost::apply_visitor(v, n);
-}
-
-// element's indexable type
-
-template <typename Value, typename Parameters, typename Box, typename Allocators, typename Tag, typename Translator>
-struct element_indexable_type<
- std::pair<
- Box,
- boost::variant<
- leaf_variant<Value, Parameters, Box, Allocators, Tag>,
- internal_node_variant<Value, Parameters, Box, Allocators, Tag>
- > *
- >,
- Translator
->
-{
- typedef Box type;
-};
-
-// element's indexable getter
-
-template <typename Value, typename Parameters, typename Box, typename Allocators, typename Tag, typename Translator>
-inline Box const&
-element_indexable(std::pair<
- Box,
- boost::variant<
- leaf_variant<Value, Parameters, Box, Allocators, Tag>,
- internal_node_variant<Value, Parameters, Box, Allocators, Tag>
- > *
- > const& el,
- Translator const&)
-{
- return el.first;
-}
-
-// allocators
-
-template <typename Allocator, typename Value, typename Parameters, typename Box>
-struct allocators<Allocator, Value, Parameters, Box, node_s_mem_dynamic_tag>
-{
- 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_s_mem_dynamic_tag>::type
- >::other node_allocator_type;
-
- typedef typename allocator_type::template rebind<
- std::pair<Box, typename node<Value, Parameters, Box, allocators, node_s_mem_dynamic_tag>::type *>
- >::other internal_node_elements_allocator_type;
-
- typedef typename allocator_type::template rebind<
- Value
- >::other leaf_elements_allocator_type;
-
- inline explicit allocators(Allocator alloc)
- : allocator(alloc)
- , node_allocator(allocator)
- , internal_node_elements_allocator(allocator)
- , leaf_elements_allocator(allocator)
- {}
-
- allocator_type allocator;
- node_allocator_type node_allocator;
- internal_node_elements_allocator_type internal_node_elements_allocator;
- leaf_elements_allocator_type leaf_elements_allocator;
-};
-
-// create_node_variant
-
-template <typename Node>
-struct create_node_variant
-{
- template <typename RetNode, typename AllocNode, typename AllocElems>
- static inline RetNode * apply(AllocNode & alloc_node, AllocElems & alloc_elems)
- {
- RetNode * p = alloc_node.allocate(1);
-
- if ( 0 == p )
- throw std::bad_alloc();
-
- try
- {
- alloc_node.construct(p, Node(alloc_elems));
- }
- catch(...)
- {
- alloc_node.deallocate(p, 1);
- throw;
- }
-
- return p;
- }
-};
-
-// destroy_node_variant
-
-template <typename Node>
-struct destroy_node_variant
-{
- template <typename AllocNode, typename BaseNode>
- static inline void apply(AllocNode & alloc_node, BaseNode * n)
- {
- alloc_node.destroy(n);
- alloc_node.deallocate(n, 1);
- }
-};
-
-// create_node
-
-template <typename Allocators, typename Value, typename Parameters, typename Box, typename Tag>
-struct create_node<
- Allocators,
- internal_node_variant<Value, Parameters, Box, Allocators, Tag>
->
-{
- static inline typename node<Value, Parameters, Box, Allocators, Tag>::type *
- apply(Allocators & allocators)
- {
- return create_node_variant<
- internal_node_variant<Value, Parameters, Box, Allocators, Tag>
- >::template apply<
- typename node<Value, Parameters, Box, Allocators, Tag>::type
- >(allocators.node_allocator, allocators.internal_node_elements_allocator);
- }
-};
-
-template <typename Allocators, typename Value, typename Parameters, typename Box, typename Tag>
-struct create_node<
- Allocators,
- leaf_variant<Value, Parameters, Box, Allocators, Tag>
->
-{
- static inline typename node<Value, Parameters, Box, Allocators, Tag>::type *
- apply(Allocators & allocators)
- {
- return create_node_variant<
- leaf_variant<Value, Parameters, Box, Allocators, Tag>
- >::template apply<
- typename node<Value, Parameters, Box, Allocators, Tag>::type
- >(allocators.node_allocator, allocators.leaf_elements_allocator);
- }
-};
-
-// destroy_node
-
-template <typename Allocators, typename Value, typename Parameters, typename Box, typename Tag>
-struct destroy_node<
- Allocators,
- internal_node_variant<Value, Parameters, Box, Allocators, Tag>
->
-{
- static inline void apply(Allocators & allocators, typename node<Value, Parameters, Box, Allocators, Tag>::type * n)
- {
- destroy_node_variant<
- internal_node_variant<Value, Parameters, Box, Allocators, Tag>
- >::apply(allocators.node_allocator, n);
- }
-};
-
-template <typename Allocators, typename Value, typename Parameters, typename Box, typename Tag>
-struct destroy_node<
- Allocators,
- leaf_variant<Value, Parameters, Box, Allocators, Tag>
->
-{
- static inline void apply(Allocators & allocators, typename node<Value, Parameters, Box, Allocators, Tag>::type * n)
- {
- destroy_node_variant<
- leaf_variant<Value, Parameters, Box, Allocators, Tag>
- >::apply(allocators.node_allocator, n);
- }
-};
-
-}} // namespace detail::rtree
-
-}}} // namespace boost::geometry::index
-
-#endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_NODE_NODE_DEFAULT_VARIANT_HPP


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