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::BaseLeaf< CAPACITY, TYPE > Class Template Reference

Public Member Functions

 BaseLeaf (const BaseLeaf &)=delete
BaseLeaf & operator= (const BaseLeaf &)=delete
bool HasByte (const uint8_t byte) const
 Returns true, if the byte exists, else false.
array_ptr< uint8_t > GetBytes ()
bool GetNextByte (uint8_t &byte) const

Static Public Member Functions

static NodeHandle< BaseLeaf > New (ART &art, Node &node)
 Get a new BaseLeaf and initialize it.

Static Private Member Functions

static void InsertByteInternal (BaseLeaf &n, const uint8_t byte)
static NodeHandle< BaseLeaf > DeleteByteInternal (ART &art, Node &node, const uint8_t byte)

Private Attributes

uint8_t count
uint8_t key [CAPACITY]

Friends

class Node7Leaf
class Node15Leaf
class Node256Leaf

Member Function Documentation

◆ New()

template<uint8_t CAPACITY, NType TYPE>
NodeHandle< BaseLeaf > duckdb::BaseLeaf< CAPACITY, TYPE >::New ( ART & art,
Node & node )
inlinestatic

Get a new BaseLeaf and initialize it.

150900 {
150902 node.SetMetadata(static_cast<uint8_t>(TYPE));
150903
150905 auto &n = handle.Get();
150906
150907 n.count = 0;
150908 return handle;
150909 }
Definition duckdb.cpp:150884
IndexPointer New()
Get a new IndexPointer to a segment, might cause a new buffer allocation.
Definition duckdb.cpp:156189
static FixedSizeAllocator & GetAllocator(const ART &art, const NType type)
Get a reference to the allocator.
Definition duckdb.cpp:154663
Here is the call graph for this function:

◆ HasByte()

template<uint8_t CAPACITY, NType TYPE>
bool duckdb::BaseLeaf< CAPACITY, TYPE >::HasByte ( const uint8_t byte) const
inline

Returns true, if the byte exists, else false.

150912 {
150913 for (uint8_t i = 0; i < count; i++) {
150914 if (key[i] == byte) {
150915 return true;
150916 }
150917 }
150918 return false;
150919 }

◆ GetBytes()

template<uint8_t CAPACITY, NType TYPE>
array_ptr< uint8_t > duckdb::BaseLeaf< CAPACITY, TYPE >::GetBytes ( )
inline

Returns a pointer to the bytes in the leaf. The pointer's data is valid as long as the leaf is valid.

150923 {
150924 return array_ptr<uint8_t>(key, count);
150925 }

◆ GetNextByte()

template<uint8_t CAPACITY, NType TYPE>
bool duckdb::BaseLeaf< CAPACITY, TYPE >::GetNextByte ( uint8_t & byte) const
inline

Get the first byte greater than or equal to the byte. Returns true, if such a byte exists, else false.

150929 {
150930 for (uint8_t i = 0; i < count; i++) {
150931 if (key[i] >= byte) {
150932 byte = key[i];
150933 return true;
150934 }
150935 }
150936 return false;
150937 }

◆ InsertByteInternal()

template<uint8_t CAPACITY, NType TYPE>
void duckdb::BaseLeaf< CAPACITY, TYPE >::InsertByteInternal ( BaseLeaf< CAPACITY, TYPE > & n,
const uint8_t byte )
staticprivate
153448 {
153449 // Still space. Insert the child.
153450 uint8_t child_pos = 0;
153451 while (child_pos < n.count && n.key[child_pos] < byte) {
153452 child_pos++;
153453 }
153454
153455 // Move children backwards to make space.
153456 for (uint8_t i = n.count; i > child_pos; i--) {
153457 n.key[i] = n.key[i - 1];
153458 }
153459
153460 n.key[child_pos] = byte;
153461 n.count++;
153462}

◆ DeleteByteInternal()

template<uint8_t CAPACITY, NType TYPE>
NodeHandle< BaseLeaf< CAPACITY, TYPE > > duckdb::BaseLeaf< CAPACITY, TYPE >::DeleteByteInternal ( ART & art,
Node & node,
const uint8_t byte )
staticprivate
153466 {
153468 auto &n = handle.Get();
153469 uint8_t child_pos = 0;
153470
153471 for (; child_pos < n.count; child_pos++) {
153472 if (n.key[child_pos] == byte) {
153473 break;
153474 }
153475 }
153476 n.count--;
153477
153478 // Possibly move children backwards.
153479 for (uint8_t i = child_pos; i < n.count; i++) {
153480 n.key[i] = n.key[i + 1];
153481 }
153482 return handle;
153483}

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