// Boost.Geometry Index // // R-tree node elements access // // Copyright (c) 2011-2015 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_INDEX_DETAIL_RTREE_NODE_NODE_ELEMENTS_HPP #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_NODE_NODE_ELEMENTS_HPP #include #include #include #include namespace boost { namespace geometry { namespace index { namespace detail { namespace rtree { // element's indexable type template struct element_indexable_type { typedef typename indexable_type::type type; }; template struct element_indexable_type< rtree::ptr_pair, Translator > { typedef First type; }; // is leaf element template struct is_leaf_element { static const bool value = true; }; template struct is_leaf_element< rtree::ptr_pair > { static const bool value = false; }; // element's indexable getter template typename result_type::type element_indexable(Element const& el, Translator const& tr) { return tr(el); } template First const& element_indexable(rtree::ptr_pair const& el, Translator const& /*tr*/) { return el.first; } // nodes elements template struct elements_type { typedef typename Node::elements_type type; }; template inline typename elements_type::type & elements(Node & n) { return n.elements; } template inline typename elements_type::type const& elements(Node const& n) { return n.elements; } // elements derived type template struct container_from_elements_type { typedef boost::container::vector type; }; template struct container_from_elements_type, NewValue> { typedef detail::varray type; }; }} // namespace detail::rtree }}} // namespace boost::geometry::index #endif // BOOST_GEOMETRY_INDEX_DETAIL_RTREE_NODE_NODE_ELEMENTS_HPP