9
3

is_leaf.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Boost.Geometry Index
  2. //
  3. // R-tree leaf node checking visitor implementation
  4. //
  5. // Copyright (c) 2011-2015 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. #ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_IS_LEAF_HPP
  11. #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_IS_LEAF_HPP
  12. namespace boost { namespace geometry { namespace index {
  13. namespace detail { namespace rtree { namespace visitors {
  14. template <typename Value, typename Options, typename Box, typename Allocators>
  15. struct is_leaf : public rtree::visitor<Value, typename Options::parameters_type, Box, Allocators, typename Options::node_tag, true>::type
  16. {
  17. typedef typename rtree::internal_node<Value, typename Options::parameters_type, Box, Allocators, typename Options::node_tag>::type internal_node;
  18. typedef typename rtree::leaf<Value, typename Options::parameters_type, Box, Allocators, typename Options::node_tag>::type leaf;
  19. is_leaf()
  20. : result(false)
  21. {}
  22. inline void operator()(internal_node const&)
  23. {
  24. // result = false;
  25. }
  26. inline void operator()(leaf const&)
  27. {
  28. result = true;
  29. }
  30. bool result;
  31. };
  32. }}} // namespace detail::rtree::visitors
  33. }}} // namespace boost::geometry::index
  34. #endif // BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_IS_LEAF_HPP