]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/geometry/include/boost/geometry/index/detail/rtree/node/variant_visitor.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / geometry / include / boost / geometry / index / detail / rtree / node / variant_visitor.hpp
CommitLineData
7c673cae
FG
1// Boost.Geometry Index
2//
3// R-tree nodes static visitor related code
4//
5// Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland.
6//
7// Use, modification and distribution is subject to the Boost Software License,
8// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
9// http://www.boost.org/LICENSE_1_0.txt)
10
11#ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_NODE_VARIANT_VISITOR_HPP
12#define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_NODE_VARIANT_VISITOR_HPP
13
14#include <boost/variant/apply_visitor.hpp>
15#include <boost/variant/get.hpp>
16#include <boost/variant/variant.hpp>
17
18namespace boost { namespace geometry { namespace index {
19
20namespace detail { namespace rtree {
21
22// nodes variants forward declarations
23
24template <typename Value, typename Parameters, typename Box, typename Allocators, typename Tag>
25struct variant_internal_node;
26
27template <typename Value, typename Parameters, typename Box, typename Allocators, typename Tag>
28struct variant_leaf;
29
30// nodes conversion
31
32template <typename V, typename Value, typename Parameters, typename Box, typename Allocators, typename Tag>
33inline V & get(
34 boost::variant<
35 variant_leaf<Value, Parameters, Box, Allocators, Tag>,
36 variant_internal_node<Value, Parameters, Box, Allocators, Tag>
37 > & v)
38{
39 return boost::get<V>(v);
40}
41
42// apply visitor
43
44template <typename Visitor, typename Value, typename Parameters, typename Box, typename Allocators, typename Tag>
45inline void apply_visitor(Visitor & v,
46 boost::variant<
47 variant_leaf<Value, Parameters, Box, Allocators, Tag>,
48 variant_internal_node<Value, Parameters, Box, Allocators, Tag>
49 > & n)
50{
51 boost::apply_visitor(v, n);
52}
53
54template <typename Visitor, typename Value, typename Parameters, typename Box, typename Allocators, typename Tag>
55inline void apply_visitor(Visitor & v,
56 boost::variant<
57 variant_leaf<Value, Parameters, Box, Allocators, Tag>,
58 variant_internal_node<Value, Parameters, Box, Allocators, Tag>
59 > const& n)
60{
61 boost::apply_visitor(v, n);
62}
63
64}} // namespace detail::rtree
65
66}}} // namespace boost::geometry::index
67
68#endif // BOOST_GEOMETRY_INDEX_DETAIL_RTREE_NODE_VARIANT_VISITOR_HPP