◆ IndexPointer() [1/2]
| duckdb::IndexPointer::IndexPointer |
( |
| ) |
|
|
inline |
Constructs an empty IndexPointer.
idx_t data
Definition duckdb.hpp:22587
◆ IndexPointer() [2/2]
Constructs an in-memory IndexPointer with a buffer ID and an offset.
22520 auto shifted_offset = UnsafeNumericCast<idx_t>(offset) <<
SHIFT_OFFSET;
22521 data += shifted_offset;
22523 };
static constexpr idx_t SHIFT_OFFSET
Bit-shifting.
Definition duckdb.hpp:22508
◆ Get()
| idx_t duckdb::IndexPointer::Get |
( |
| ) |
const |
|
inline |
◆ Set()
◆ HasMetadata()
| bool duckdb::IndexPointer::HasMetadata |
( |
| ) |
const |
|
inline |
Returns false, if the metadata is empty.
22536 {
22537 return data & AND_METADATA;
22538 }
◆ GetMetadata()
| uint8_t duckdb::IndexPointer::GetMetadata |
( |
| ) |
const |
|
inline |
Get metadata (Bits 56-63)
22540 {
22541 return data >> SHIFT_METADATA;
22542 }
◆ SetMetadata()
Set metadata (Bits 56-63)
22544 {
22545 data &= ~AND_METADATA;
22546 data |= UnsafeNumericCast<idx_t>(metadata) << SHIFT_METADATA;
22547 }
◆ GetOffset()
| idx_t duckdb::IndexPointer::GetOffset |
( |
| ) |
const |
|
inline |
Get the offset (Bits 32-55)
22550 {
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 |
◆ IncreaseBufferId()
Adds an idx_t to a buffer ID, the rightmost 32 bits of data (Bits 0-31) contain the buffer ID.
◆ operator==()
Comparison operator.
22570 {
22571 return data == ptr.data;
22572 }
◆ 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: