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::IndexPointer Class Reference
Inheritance diagram for duckdb::IndexPointer:

Public Member Functions

 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 Attributes

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
 

Private Attributes

idx_t data
 

Constructor & Destructor Documentation

◆ IndexPointer() [1/2]

duckdb::IndexPointer::IndexPointer ( )
inline

Constructs an empty IndexPointer.

22517: data(0) {};
idx_t data
Definition duckdb.hpp:22587

◆ IndexPointer() [2/2]

duckdb::IndexPointer::IndexPointer ( const uint32_t  buffer_id,
const uint32_t  offset 
)
inline

Constructs an in-memory IndexPointer with a buffer ID and an offset.

22519 : data(0) {
22520 auto shifted_offset = UnsafeNumericCast<idx_t>(offset) << SHIFT_OFFSET;
22521 data += shifted_offset;
22522 data += buffer_id;
22523 };
static constexpr idx_t SHIFT_OFFSET
Bit-shifting.
Definition duckdb.hpp:22508

Member Function Documentation

◆ Get()

idx_t duckdb::IndexPointer::Get ( ) const
inline

Get data (all 64 bits)

22527 {
22528 return data;
22529 }
Here is the caller graph for this function:

◆ Set()

void duckdb::IndexPointer::Set ( const idx_t  data_p)
inline

Set data (all 64 bits)

22531 {
22532 data = data_p;
22533 }
Here is the caller graph for this function:

◆ HasMetadata()

bool duckdb::IndexPointer::HasMetadata ( ) const
inline

Returns false, if the metadata is empty.

22536 {
22537 return data & AND_METADATA;
22538 }
Here is the caller graph for this function:

◆ GetMetadata()

uint8_t duckdb::IndexPointer::GetMetadata ( ) const
inline

Get metadata (Bits 56-63)

22540 {
22541 return data >> SHIFT_METADATA;
22542 }
Here is the caller graph for this function:

◆ SetMetadata()

void duckdb::IndexPointer::SetMetadata ( const uint8_t  metadata)
inline

Set metadata (Bits 56-63)

22544 {
22545 data &= ~AND_METADATA;
22546 data |= UnsafeNumericCast<idx_t>(metadata) << SHIFT_METADATA;
22547 }
Here is the caller graph for this function:

◆ GetOffset()

idx_t duckdb::IndexPointer::GetOffset ( ) const
inline

Get the offset (Bits 32-55)

22550 {
22551 auto offset = data >> SHIFT_OFFSET;
22552 return offset & AND_OFFSET;
22553 }
static constexpr idx_t AND_OFFSET
AND operations.
Definition duckdb.hpp:22511

◆ GetBufferId()

idx_t duckdb::IndexPointer::GetBufferId ( ) const
inline

Get the buffer ID (Bits 0-31)

22555 {
22556 return data & AND_BUFFER_ID;
22557 }

◆ Clear()

void duckdb::IndexPointer::Clear ( )
inline

Resets the IndexPointer.

22560 {
22561 data = 0;
22562 }

◆ IncreaseBufferId()

void duckdb::IndexPointer::IncreaseBufferId ( const idx_t  summand)
inline

Adds an idx_t to a buffer ID, the rightmost 32 bits of data (Bits 0-31) contain the buffer ID.

22565 {
22566 data += summand;
22567 }

◆ operator==()

bool duckdb::IndexPointer::operator== ( const IndexPointer ptr) const
inline

Comparison operator.

22570 {
22571 return data == ptr.data;
22572 }

Member Data Documentation

◆ data

idx_t duckdb::IndexPointer::data
private

Data holds all the information contained in an IndexPointer (64-bit value) Bit layout: MSB LSB 63 56 55 32 31 0 +---------—+-----------------------—+---------------------------------—+ | Metadata | Offset | Buffer ID | | 8 bits | 24 bits | 32 bits | +---------—+-----------------------—+---------------------------------—+ NOTE: we do not use bit fields because when using bit fields Windows compiles the IndexPointer class into 16 bytes instead of the intended 8 bytes, doubling the space requirements https://learn.microsoft.com/en-us/cpp/cpp/cpp-bit-fields?view=msvc-170


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