is_leaf.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. // 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. //
  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. #ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_IS_LEAF_HPP
  15. #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_IS_LEAF_HPP
  16. namespace boost { namespace geometry { namespace index {
  17. namespace detail { namespace rtree { namespace visitors {
  18. template <typename MembersHolder>
  19. struct is_leaf
  20. : public MembersHolder::visitor_const
  21. {
  22. typedef typename MembersHolder::internal_node internal_node;
  23. typedef typename MembersHolder::leaf leaf;
  24. is_leaf()
  25. : result(false)
  26. {}
  27. inline void operator()(internal_node const&)
  28. {
  29. // result = false;
  30. }
  31. inline void operator()(leaf const&)
  32. {
  33. result = true;
  34. }
  35. bool result;
  36. };
  37. }}} // namespace detail::rtree::visitors
  38. }}} // namespace boost::geometry::index
  39. #endif // BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_IS_LEAF_HPP