UFO 1.0.0
An Efficient Probabilistic 3D Mapping Framework That Embraces the Unknown
Loading...
Searching...
No Matches
inner.hpp
1
42#ifndef UFO_CONTAINER_TREE_PREDICATE_INNER_HPP
43#define UFO_CONTAINER_TREE_PREDICATE_INNER_HPP
44
45// UFO
46#include <ufo/container/tree/predicate/filter.hpp>
47
48namespace ufo::pred
49{
50struct Inner {
51};
52
53static constexpr inline Inner const inner;
54
55template <>
56struct Filter<Inner> {
57 using Pred = Inner;
58
59 template <class Tree>
60 static constexpr void init(Pred&, Tree const&) noexcept
61 {
62 }
63
64 template <class Value>
65 [[nodiscard]] static constexpr bool returnableValue(Pred const&, Value const&) noexcept
66 {
67 return true;
68 }
69
70 template <class Tree>
71 [[nodiscard]] static constexpr bool returnable(Pred const&, Tree const& t,
72 typename Tree::Node const& n) noexcept
73 {
74 return 0 < t.depth(n);
75 }
76
77 template <class Tree>
78 [[nodiscard]] static constexpr bool traversable(Pred const&, Tree const& t,
79 typename Tree::Node const& n) noexcept
80 {
81 return 1 < t.depth(n);
82 }
83
84 template <class Tree>
85 [[nodiscard]] static constexpr bool returnableRay(Pred const& p, Tree const& t,
86 typename Tree::Node const& n,
87 typename Tree::Ray const&) noexcept
88 {
89 return returnable(p, t, n);
90 }
91
92 template <class Tree>
93 [[nodiscard]] static constexpr bool traversableRay(Pred const& p, Tree const& t,
94 typename Tree::Node const& n,
95 typename Tree::Ray const&) noexcept
96 {
97 return traversable(p, t, n);
98 }
99};
100} // namespace ufo::pred
101
102#endif // UFO_CONTAINER_TREE_PREDICATE_INNER_HPP
Utilizing curiously recurring template pattern (CRTP)
Definition tree.hpp:104
depth_type depth() const
Returns the depth of the root node, i.e. numDepthLevels() - 1.
Definition tree.hpp:290