]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/geometry/index/detail/rtree/visitors/children_box.hpp
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / boost / boost / geometry / index / detail / rtree / visitors / children_box.hpp
CommitLineData
7c673cae
FG
1// Boost.Geometry Index
2//
3// R-tree node children box calculating visitor implementation
4//
5// Copyright (c) 2011-2015 Adam Wulkiewicz, Lodz, Poland.
6//
92f5a8d4
TL
7// This file was modified by Oracle on 2019.
8// Modifications copyright (c) 2019 Oracle and/or its affiliates.
9// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
10//
7c673cae
FG
11// Use, modification and distribution is subject to the Boost Software License,
12// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
13// http://www.boost.org/LICENSE_1_0.txt)
14
15#ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_CHILDREN_BOX_HPP
16#define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_CHILDREN_BOX_HPP
17
18namespace boost { namespace geometry { namespace index {
19
20namespace detail { namespace rtree { namespace visitors {
21
f67539c2 22template <typename MembersHolder>
7c673cae 23class children_box
f67539c2 24 : public MembersHolder::visitor_const
7c673cae 25{
f67539c2
TL
26 typedef typename MembersHolder::parameters_type parameters_type;
27 typedef typename MembersHolder::translator_type translator_type;
28 typedef typename MembersHolder::box_type box_type;
92f5a8d4 29
f67539c2
TL
30 typedef typename MembersHolder::internal_node internal_node;
31 typedef typename MembersHolder::leaf leaf;
7c673cae
FG
32
33public:
f67539c2
TL
34 inline children_box(box_type & result,
35 parameters_type const& parameters,
36 translator_type const& tr)
92f5a8d4 37 : m_result(result), m_parameters(parameters), m_tr(tr)
7c673cae
FG
38 {}
39
40 inline void operator()(internal_node const& n)
41 {
42 typedef typename rtree::elements_type<internal_node>::type elements_type;
43 elements_type const& elements = rtree::elements(n);
44
f67539c2
TL
45 m_result = rtree::elements_box<box_type>(elements.begin(), elements.end(), m_tr,
46 index::detail::get_strategy(m_parameters));
7c673cae
FG
47 }
48
49 inline void operator()(leaf const& n)
50 {
51 typedef typename rtree::elements_type<leaf>::type elements_type;
52 elements_type const& elements = rtree::elements(n);
53
f67539c2
TL
54 m_result = rtree::values_box<box_type>(elements.begin(), elements.end(), m_tr,
55 index::detail::get_strategy(m_parameters));
7c673cae
FG
56 }
57
58private:
f67539c2 59 box_type & m_result;
92f5a8d4 60 parameters_type const& m_parameters;
f67539c2 61 translator_type const& m_tr;
7c673cae
FG
62};
63
64}}} // namespace detail::rtree::visitors
65
66}}} // namespace boost::geometry::index
67
68#endif // BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_CHILDREN_BOX_HPP