◆ New()
template<
uint8_t CAPACITY, NType TYPE>
Get a new BaseNode handle and initialize the base node.
57961 {
57964
57965 NodeHandle<BaseNode> handle(art, node);
57966 auto &n = handle.Get();
57967
57968
57969 n.count = 0;
57970
57971 for (
uint8_t i = 0; i < CAPACITY; i++) {
57972 n.key[i] = 0;
57973 n.children[i].Clear();
57974 }
57975
57976 return handle;
57977 }
static FixedSizeAllocator & GetAllocator(const ART &art, const NType type)
Get a reference to the allocator.
◆ ReplaceChild()
template<
uint8_t CAPACITY, NType TYPE>
Replace the child at byte.
57980 {
57981 D_ASSERT(n.count != 0);
57982 for (
uint8_t i = 0; i < n.count; i++) {
57983 if (n.key[i] == byte) {
57984 auto status = n.children[i].GetGateStatus();
57985 n.children[i] = child;
57986
57987 if (status == GateStatus::GATE_SET && child.HasMetadata()) {
57988 n.children[i].SetGateStatus(status);
57989 }
57990 return;
57991 }
57992 }
57993 }
◆ GetChild()
template<
uint8_t CAPACITY, NType TYPE>
Get the child at byte.
57996 {
57997 for (
uint8_t i = 0; i < n.count; i++) {
57998 if (n.key[i] == byte) {
57999 if (!unsafe && !n.children[i].HasMetadata()) {
58000 throw InternalException("empty child i = %d for byte %d in BaseNode::GetChild", i, byte);
58001 }
58002 return &n.children[i];
58003 }
58004 }
58005 return nullptr;
58006 }
◆ GetNextChild()
template<
uint8_t CAPACITY, NType TYPE>
Get the first child greater than or equal to the byte.
58009 {
58010 for (
uint8_t i = 0; i < n.count; i++) {
58011 if (n.key[i] >= byte) {
58012 byte = n.key[i];
58013 return &n.children[i];
58014 }
58015 }
58016 return nullptr;
58017 }
◆ ExtractChildren()
template<
uint8_t CAPACITY, NType TYPE>
Extracts the bytes and their respective children. The return value is valid as long as the arena is valid. The node must be freed after calling into this function.
58022 {
58023 auto mem_bytes = arena.AllocateAligned(
sizeof(
uint8_t) * count);
58024 array_ptr<uint8_t> bytes(mem_bytes, count);
58025 auto mem_children = arena.AllocateAligned(sizeof(Node) * count);
58026 array_ptr<Node> children_ptr(reinterpret_cast<Node *>(mem_children), count);
58027
58028 for (
uint8_t i = 0; i < count; i++) {
58029 bytes[i] = key[i];
58030 children_ptr[i] = children[i];
58031 }
58032
58033 return NodeChildren(bytes, children_ptr);
58034 }
◆ Iterator()
template<
uint8_t CAPACITY, NType TYPE>
58038 {
58039 for (
uint8_t i = 0; i < n.count; i++) {
58040 lambda(n.children[i]);
58041 }
58042 }
The documentation for this class was generated from the following file:
- external/duckdb/duckdb.cpp