15namespace AvailabilityUtilities {
16uint8_t countOnesInByte(uint8_t _byte);
17uint32_t countOnesInBuffer(std::span<const std::byte> buffer);
85 std::vector<std::vector<std::byte>>
buffers;
99 std::optional<AvailabilitySubtree>
subtree;
118 void setLoadedSubtree(
120 uint32_t maxChildrenSubtrees) noexcept;
130 std::unique_ptr<AvailabilityNode>
pRoot;
157 return pBufferView !=
nullptr && bufferAccessor;
167 bool isConstant() const noexcept {
return pConstant !=
nullptr; }
185 return *bufferAccessor;
196 return bufferAccessor.value()[i];
206 size_t size()
const {
return pBufferView->byteLength; }
211 std::optional<std::span<const std::byte>> bufferAccessor;
Accessor for use with AvailabilityView in order to safely obtain the contents of the view.
const std::span< const std::byte > & getBufferAccessor() const
Obtains an accessor to the buffer used by the AvailabilityView.
size_t size() const
Obtains the size of the buffer used by the AvailabilityView.
bool isBufferView() const noexcept
Is this AvailabilityAccessor accessing a SubtreeBufferView?
const std::byte & operator[](size_t i) const
Obtains the byte at the given index from the buffer used by the AvailabilityView.
AvailabilityAccessor(const AvailabilityView &view, const AvailabilitySubtree &subtree) noexcept
Creates a new AvailabilityAccessor.
bool getConstant() const
Obtains the constant value of the AvailabilityView.
bool isConstant() const noexcept
Is this AvailabilityAccessor accessing a ConstantAvailability?
Basic geometry classes for Cesium.
std::variant< ConstantAvailability, SubtreeBufferView > AvailabilityView
A view into availability information for part of the availability tree. This could be either a consta...
Availability nodes wrap AvailabilitySubtree objects and link them together to form a downwardly trave...
AvailabilityNode() noexcept
Creates an empty instance;.
std::optional< AvailabilitySubtree > subtree
The subtree data for this node.
std::vector< std::unique_ptr< AvailabilityNode > > childNodes
The child nodes for this subtree node.
The subtree data for an AvailabilityNode, containing information on tile, content,...
AvailabilityView contentAvailability
The availability information corresponding to TileAvailabilityFlags::CONTENT_AVAILABLE.
std::vector< std::vector< std::byte > > buffers
Subtree buffers that may be referenced by a SubtreeBufferView.
AvailabilityView subtreeAvailability
The availability information corresponding to TileAvailabilityFlags::SUBTREE_AVAILABLE and TileAvaila...
AvailabilityView tileAvailability
The availability information corresponding to TileAvailabilityFlags::TILE_AVAILABLE.
A downwardly-traversable tree of AvailabilityNode objects.
std::unique_ptr< AvailabilityNode > pRoot
The root AvailabilityNode of this tree.
An availability value that is a constant boolean value.
bool constant
The constant value.
An availability value that needs to be obtained using an offset into a buffer.
uint32_t byteLength
The number of bytes after the offset to read until.
uint8_t buffer
The index into AvailabilitySubtree::buffers that this SubtreeBufferView corresponds to.
uint32_t byteOffset
The offset into the buffer to read from.