UFO
1.0.0
An Efficient Probabilistic 3D Mapping Framework That Embraces the Unknown
Loading...
Searching...
No Matches
leaf.hpp
1
42
#ifndef UFO_CONTAINER_TREE_PREDICATE_LEAF_HPP
43
#define UFO_CONTAINER_TREE_PREDICATE_LEAF_HPP
44
45
// UFO
46
#include <ufo/container/tree/predicate/filter.hpp>
47
48
namespace
ufo::pred
49
{
50
struct
Leaf
{
51
};
52
53
static
constexpr
inline
Leaf
const
leaf;
54
55
template
<>
56
struct
Filter
<
Leaf
> {
57
using
Pred
=
Leaf
;
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
!t.
isParent
(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
true
;
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_LEAF_HPP
ufo::Tree
Utilizing curiously recurring template pattern (CRTP)
Definition
tree.hpp:104
ufo::Tree::isParent
bool isParent(NodeType node) const
Checks if the node is a parent (i.e., has children).
Definition
tree.hpp:1308
ufo::pred
Definition
predicate.hpp:74
ufo::Ray< Dim, coord_type >
ufo::TreeNode
Definition
node.hpp:57
ufo::pred::Filter
Definition
filter.hpp:51
ufo::pred::Leaf
Definition
leaf.hpp:50
lib
container
include
ufo
container
tree
predicate
leaf.hpp
Generated by
1.9.8