FlatCityBuf C++ reader 0.8.0
Native C++17 reader for FlatCityBuf, the cloud-optimized CityJSON format
Loading...
Searching...
No Matches
btree_builder.hpp
Go to the documentation of this file.
1#pragma once
2
3#ifdef FCB_WITH_JSON
4
5# include <fcb/key.hpp>
6# include <fcb/stree.hpp>
7
8# include <cstdint>
9# include <vector>
10
11namespace fcb {
12
16constexpr std::uint16_t kDefaultBranchingFactor = 16;
17
23struct BtreeEntry {
25 std::uint64_t offset;
26};
27
38 std::vector<std::uint8_t> bytes;
39 std::uint16_t branching_factor;
40 std::uint32_t num_unique_items;
41};
42
56BuiltBtreeIndex build_static_btree(const std::vector<BtreeEntry>& entries, KeyKind kind,
57 std::uint16_t branching_factor);
58
59} // namespace fcb
60
61#endif // FCB_WITH_JSON
A decoded index key.
Definition key.hpp:40
constexpr std::uint16_t kDefaultBranchingFactor
Mirrors static_btree::DEFAULT_BRANCHING_FACTOR (static_btree/mod.rs:19), used whenever a caller reque...
BuiltBtreeIndex build_static_btree(const std::vector< BtreeEntry > &entries, KeyKind kind, std::uint16_t branching_factor)
Builds one column's complete attribute index blob from its (key, offset) entries.
KeyKind
The concrete key types the B+tree index can hold.
Definition key.hpp:14
KeyKind kind
Definition stree.cpp:166
One (key, feature byte offset) pair to be indexed.
std::uint64_t offset
The finished index: the flat node array concatenated with the payload section (mirrors Stree::stream_...
std::vector< std::uint8_t > bytes
std::uint32_t num_unique_items
std::uint16_t branching_factor