Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::Node Class Reference
Inheritance diagram for duckdb::Node:
Collaboration diagram for duckdb::Node:

Public Member Functions

void ReplaceChild (const ART &art, const uint8_t byte, const Node child=Node()) const
 Replace the child at byte.
 
const unsafe_optional_ptr< NodeGetChild (ART &art, const uint8_t byte) const
 Get the immutable child at byte.
 
unsafe_optional_ptr< NodeGetChildMutable (ART &art, const uint8_t byte, const bool unsafe=false) const
 Get the child at byte.
 
const unsafe_optional_ptr< NodeGetNextChild (ART &art, uint8_t &byte) const
 Get the first immutable child greater than or equal to the byte.
 
bool HasByte (ART &art, const uint8_t byte) const
 Returns true, if the byte exists, else false.
 
bool GetNextByte (ART &art, uint8_t &byte) const
 Get the first byte greater than or equal to the byte.
 
void Verify (ART &art) const
 Traverses and verifies the node.
 
void VerifyAllocations (ART &art, unordered_map< uint8_t, idx_t > &node_counts) const
 Counts each node type.
 
string ToString (ART &art, const ToStringOptions &options) const
 
NType GetType () const
 Returns the node type.
 
bool IsNode () const
 True, if the node is a Node4, Node16, Node48, or Node256.
 
bool IsLeafNode () const
 True, if the node is a Node7Leaf, Node15Leaf, or Node256Leaf.
 
bool IsAnyLeaf () const
 True, if the node is any leaf.
 
row_t GetRowId () const
 Get the row ID (8th to 63rd bit).
 
void SetRowId (const row_t row_id)
 Set the row ID (8th to 63rd bit).
 
GateStatus GetGateStatus () const
 Returns the gate status of a node.
 
void SetGateStatus (const GateStatus status)
 Sets the gate status of a node.
 
void operator= (const IndexPointer &ptr)
 Assign operator.
 
- Public Member Functions inherited from duckdb::IndexPointer
 IndexPointer ()
 Constructs an empty IndexPointer.
 
 IndexPointer (const uint32_t buffer_id, const uint32_t offset)
 Constructs an in-memory IndexPointer with a buffer ID and an offset.
 
idx_t Get () const
 Get data (all 64 bits)
 
void Set (const idx_t data_p)
 Set data (all 64 bits)
 
bool HasMetadata () const
 Returns false, if the metadata is empty.
 
uint8_t GetMetadata () const
 Get metadata (Bits 56-63)
 
void SetMetadata (const uint8_t metadata)
 Set metadata (Bits 56-63)
 
idx_t GetOffset () const
 Get the offset (Bits 32-55)
 
idx_t GetBufferId () const
 Get the buffer ID (Bits 0-31)
 
void Clear ()
 Resets the IndexPointer.
 
void IncreaseBufferId (const idx_t summand)
 Adds an idx_t to a buffer ID, the rightmost 32 bits of data (Bits 0-31) contain the buffer ID.
 
bool operator== (const IndexPointer &ptr) const
 Comparison operator.
 

Static Public Member Functions

static void New (ART &art, Node &node, const NType type)
 Get a new pointer to a node and initialize it.
 
static void FreeNode (ART &art, Node &node)
 Free the node.
 
static void FreeTree (ART &art, Node &node)
 Free the node and its children.
 
static FixedSizeAllocatorGetAllocator (const ART &art, const NType type)
 Get a reference to the allocator.
 
static uint8_t GetAllocatorIdx (const NType type)
 Get the index of a node type's allocator.
 
template<class NODE >
static NODERef (const ART &art, const Node ptr, const NType type)
 Get a reference to a node.
 
template<class NODE >
static unsafe_optional_ptr< NODEInMemoryRef (const ART &art, const Node ptr, const NType type)
 Get a node pointer, if the node is in memory, else nullptr.
 
static void InsertChild (ART &art, Node &node, const uint8_t byte, const Node child=Node())
 Insert the child at byte.
 
static void DeleteChild (ART &art, Node &node, Node &prefix, const uint8_t byte, const GateStatus status, const ARTKey &row_id)
 Delete the child at byte.
 
static NType GetNodeType (const idx_t count)
 Returns the node type for a count.
 
static void TransformToDeprecated (ART &art, Node &node, TransformToDeprecatedState &state)
 Transform the node storage to deprecated storage.
 

Static Public Attributes

static constexpr uint8_t AND_GATE = 0x80
 A gate sets the leftmost bit of the metadata, binary: 1000-0000.
 
static constexpr idx_t AND_ROW_ID = 0x00FFFFFFFFFFFFFF
 
- Static Public Attributes inherited from duckdb::IndexPointer
static constexpr idx_t SHIFT_OFFSET = 32
 Bit-shifting.
 
static constexpr idx_t SHIFT_METADATA = 56
 
static constexpr idx_t AND_OFFSET = 0x0000000000FFFFFF
 AND operations.
 
static constexpr idx_t AND_BUFFER_ID = 0x00000000FFFFFFFF
 
static constexpr idx_t AND_METADATA = 0xFF00000000000000
 

Friends

class Prefix
 

Detailed Description

The Node is the pointer class of the ART index. It inherits from the IndexPointer, and adds ART-specific functionality.

Member Function Documentation

◆ Ref()

template<class NODE >
static NODE & duckdb::Node::Ref ( const ART art,
const Node  ptr,
const NType  type 
)
inlinestatic

Get a reference to a node.

11976 {
11977 D_ASSERT(ptr.GetType() != NType::PREFIX);
11978 return *(GetAllocator(art, type).Get<NODE>(ptr, !std::is_const<NODE>::value));
11979 }
static FixedSizeAllocator & GetAllocator(const ART &art, const NType type)
Get a reference to the allocator.
Here is the call graph for this function:

◆ InMemoryRef()

template<class NODE >
static unsafe_optional_ptr< NODE > duckdb::Node::InMemoryRef ( const ART art,
const Node  ptr,
const NType  type 
)
inlinestatic

Get a node pointer, if the node is in memory, else nullptr.

11982 {
11983 D_ASSERT(ptr.GetType() != NType::PREFIX);
11984 return GetAllocator(art, type).GetIfLoaded<NODE>(ptr);
11985 }
Here is the call graph for this function:

◆ ToString()

string duckdb::Node::ToString ( ART art,
const ToStringOptions options 
) const

Returns the string representation of the node at indentation level.

Parameters:

  • art: root node of tree being printed.
  • options: Printing options (see ToStringOptions struct for details).

◆ GetType()

NType duckdb::Node::GetType ( ) const
inline

Returns the node type.

12025 {
12026 return NType(GetMetadata() & ~AND_GATE);
12027 }
uint8_t GetMetadata() const
Get metadata (Bits 56-63)
Definition duckdb.hpp:22540
static constexpr uint8_t AND_GATE
A gate sets the leftmost bit of the metadata, binary: 1000-0000.
Definition duckdb.cpp:11958
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetRowId()

row_t duckdb::Node::GetRowId ( ) const
inline

Get the row ID (8th to 63rd bit).

12037 {
12038 return UnsafeNumericCast<row_t>(Get() & AND_ROW_ID);
12039 }
idx_t Get() const
Get data (all 64 bits)
Definition duckdb.hpp:22527
Here is the call graph for this function:

◆ SetRowId()

void duckdb::Node::SetRowId ( const row_t  row_id)
inline

Set the row ID (8th to 63rd bit).

12041 {
12042 Set((Get() & AND_METADATA) | UnsafeNumericCast<idx_t>(row_id));
12043 }
void Set(const idx_t data_p)
Set data (all 64 bits)
Definition duckdb.hpp:22531
Here is the call graph for this function:

◆ GetGateStatus()

GateStatus duckdb::Node::GetGateStatus ( ) const
inline

Returns the gate status of a node.

12046 {
12047 return (GetMetadata() & AND_GATE) == 0 ? GateStatus::GATE_NOT_SET : GateStatus::GATE_SET;
12048 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetGateStatus()

void duckdb::Node::SetGateStatus ( const GateStatus  status)
inline

Sets the gate status of a node.

12050 {
12051 switch (status) {
12052 case GateStatus::GATE_SET:
12053 D_ASSERT(GetType() != NType::LEAF_INLINED);
12055 break;
12056 case GateStatus::GATE_NOT_SET:
12058 break;
12059 }
12060 }
void SetMetadata(const uint8_t metadata)
Set metadata (Bits 56-63)
Definition duckdb.hpp:22544
NType GetType() const
Returns the node type.
Definition duckdb.cpp:12025
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

void duckdb::Node::operator= ( const IndexPointer ptr)
inline

Assign operator.

12063 {
12064 Set(ptr.Get());
12065 }
Here is the call graph for this function:

The documentation for this class was generated from the following file: