UFO 1.0.0
An Efficient Probabilistic 3D Mapping Framework That Embraces the Unknown
Loading...
Searching...
No Matches
inner_block.hpp
1
42#ifndef UFO_CONTAINER_TREE_INNER_BLOCK_HPP
43#define UFO_CONTAINER_TREE_INNER_BLOCK_HPP
44
45// UFO
46// #include <ufo/container/tree/code.hpp>
47#include <ufo/container/tree/index.hpp>
48
49// STL
50#include <array>
51#include <atomic>
52#include <cstddef>
53#include <cstdint>
54
55namespace ufo
56{
57template <std::size_t Dim, std::size_t BF>
59 using modified_type = std::uint16_t;
60
61 static_assert(sizeof(std::atomic<modified_type>) == sizeof(modified_type));
62 static_assert(sizeof(std::atomic<TreeIndex::pos_type>) == sizeof(TreeIndex::pos_type));
63
64 alignas(std::atomic_ref<TreeIndex::pos_type>::required_alignment)
65 std::array<TreeIndex::pos_type, BF> children;
66
67 // Code to the first node of the block
68 // std::array<typename TreeCode<Dim>::code_type, 3> code;
69
70 TreeIndex::pos_type parent_block;
71 std::uint8_t parent_offset;
72
73 std::uint8_t depth;
74
75 // Bit set saying if the node corresponding to the bit has been modified
76 alignas(std::atomic_ref<modified_type>::required_alignment) modified_type modified;
77};
78
79static_assert(24 == sizeof(TreeInnerBlock<2, 4>));
80static_assert(40 == sizeof(TreeInnerBlock<3, 8>));
81static_assert(72 == sizeof(TreeInnerBlock<4, 16>));
82
83static_assert(std::is_standard_layout_v<TreeInnerBlock<2, 4>>);
84static_assert(std::is_standard_layout_v<TreeInnerBlock<3, 8>>);
85static_assert(std::is_standard_layout_v<TreeInnerBlock<4, 16>>);
86} // namespace ufo
87
88#endif // UFO_CONTAINER_TREE_INNER_BLOCK_HPP
All vision-related classes and functions.
Definition cloud.hpp:49