Keeps track of the current key in the iterator leading down to the top node in the stack.
More...
|
| void | Push (const uint8_t key_byte) |
| | Pushes a byte into the current key.
|
| void | Pop (const idx_t n) |
| | Pops n bytes from the current key.
|
| uint8_t & | operator[] (idx_t idx) |
| | Returns the byte at idx.
|
| idx_t | Size () const |
| const_data_ptr_t | Data () const |
| | Returns a pointer to the key bytes.
|
| bool | Contains (const ARTKey &key) const |
| | Returns true, if key_bytes contains all bytes of key.
|
| bool | GreaterThan (const ARTKey &key, const bool equal, const uint8_t nested_depth) const |
| | Returns true, if key_bytes is greater than [or equal to] the key.
|
Keeps track of the current key in the iterator leading down to the top node in the stack.
◆ Push()
| void duckdb::IteratorKey::Push |
( |
const uint8_t | key_byte | ) |
|
|
inline |
Pushes a byte into the current key.
58995 {
58996 key_bytes.push_back(key_byte);
58997 }
◆ Pop()
| void duckdb::IteratorKey::Pop |
( |
const idx_t | n | ) |
|
|
inline |
Pops n bytes from the current key.
58999 {
59000 key_bytes.resize(key_bytes.size() - n);
59001 }
◆ operator[]()
Returns the byte at idx.
59003 {
59004 D_ASSERT(idx < key_bytes.size());
59005 return key_bytes[idx];
59006 }
◆ Size()
| idx_t duckdb::IteratorKey::Size |
( |
| ) |
const |
|
inline |
59008 {
59009 return key_bytes.size();
59010 }
◆ Data()
| const_data_ptr_t duckdb::IteratorKey::Data |
( |
| ) |
const |
|
inline |
Returns a pointer to the key bytes.
59012 {
59013 return const_data_ptr_cast(key_bytes.data());
59014 }
◆ Contains()
| bool duckdb::IteratorKey::Contains |
( |
const ARTKey & | key | ) |
const |
Returns true, if key_bytes contains all bytes of key.
153951 {
153952 if (
Size() < key.len) {
153953 return false;
153954 }
153955 for (
idx_t i = 0; i < key.len; i++) {
153956 if (key_bytes[i] != key.data[i]) {
153957 return false;
153958 }
153959 }
153960 return true;
153961}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
◆ GreaterThan()
| bool duckdb::IteratorKey::GreaterThan |
( |
const ARTKey & | key, |
|
|
const bool | equal, |
|
|
const uint8_t | nested_depth ) const |
Returns true, if key_bytes is greater than [or equal to] the key.
153963 {
153964 for (
idx_t i = 0; i < MinValue<idx_t>(
Size(), key.len); i++) {
153965 if (key_bytes[i] > key.data[i]) {
153966 return true;
153967 } else if (key_bytes[i] < key.data[i]) {
153968 return false;
153969 }
153970 }
153971
153972
153973 D_ASSERT(
Size() >= nested_depth);
153974 auto this_len =
Size() - nested_depth;
153975 return equal ? this_len > key.len : this_len >= key.len;
153976}
The documentation for this class was generated from the following file: