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::TupleDataChunkIterator Class Reference
Collaboration diagram for duckdb::TupleDataChunkIterator:

Public Member Functions

 TupleDataChunkIterator (TupleDataCollection &collection, TupleDataPinProperties properties, bool init_heap)
 Creates a TupleDataChunkIterator that iterates over all DataChunks in the TupleDataCollection.
 TupleDataChunkIterator (TupleDataCollection &collection, TupleDataPinProperties properties, idx_t chunk_idx_from, idx_t chunk_idx_to, bool init_heap)
 Creates a TupleDataChunkIterator that iterates over the specified DataChunk range in the TupleDataCollection.
bool Done () const
 Whether the iterator is done.
bool Next ()
 Fetches the next STANDARD_VECTOR_SIZE row locations (and heap locations/sizes if init_heap is true).
void Reset ()
 Resets the scan indices to the start.
idx_t GetCurrentChunkCount () const
 Get the count of the current "DataChunk".
TupleDataChunkState & GetChunkState ()
 Get the Chunk state of the scan state of this iterator.
data_ptr_t * GetRowLocations ()
 Get the array holding the row locations.
data_ptr_t * GetHeapLocations ()
 Get the array holding the heap locations.
idx_t * GetHeapSizes ()
 Get the array holding the heap sizes.

Private Member Functions

void InitializeCurrentChunk ()
 Initializes the row locations (and heap locations/sizes if init_heap is true) at the current scan indices.

Private Attributes

TupleDataCollection & collection
 The collection being iterated over.
bool init_heap
 Whether or not to fetch the heap locations/sizes while iterating.
idx_t start_segment_idx
 Start indices.
idx_t start_chunk_idx
idx_t end_segment_idx
 End indices.
idx_t end_chunk_idx
TupleDataScanState state
 Current scan state and scan indices.
idx_t current_segment_idx
idx_t current_chunk_idx

Constructor & Destructor Documentation

◆ TupleDataChunkIterator() [1/2]

duckdb::TupleDataChunkIterator::TupleDataChunkIterator ( TupleDataCollection & collection,
TupleDataPinProperties properties,
bool init_heap )

Creates a TupleDataChunkIterator that iterates over all DataChunks in the TupleDataCollection.

126436 : TupleDataChunkIterator(collection_p, properties_p, 0, collection_p.ChunkCount(), init_heap) {
126437}
TupleDataChunkIterator(TupleDataCollection &collection, TupleDataPinProperties properties, bool init_heap)
Creates a TupleDataChunkIterator that iterates over all DataChunks in the TupleDataCollection.
Definition duckdb.cpp:126434
bool init_heap
Whether or not to fetch the heap locations/sizes while iterating.
Definition duckdb.cpp:124417
Here is the call graph for this function:
Here is the caller graph for this function:

◆ TupleDataChunkIterator() [2/2]

duckdb::TupleDataChunkIterator::TupleDataChunkIterator ( TupleDataCollection & collection,
TupleDataPinProperties properties,
idx_t chunk_idx_from,
idx_t chunk_idx_to,
bool init_heap )

Creates a TupleDataChunkIterator that iterates over the specified DataChunk range in the TupleDataCollection.

126441 : collection(collection_p), init_heap(init_heap_p) {
126442 state.pin_state.properties = properties;
126443 D_ASSERT(chunk_idx_from < chunk_idx_to);
126444 D_ASSERT(chunk_idx_to <= collection.ChunkCount());
126445 idx_t overall_chunk_index = 0;
126446 for (idx_t segment_idx = 0; segment_idx < collection.segments.size(); segment_idx++) {
126447 const auto &segment = *collection.segments[segment_idx];
126448 if (chunk_idx_from >= overall_chunk_index && chunk_idx_from <= overall_chunk_index + segment.ChunkCount()) {
126449 // We start in this segment
126450 start_segment_idx = segment_idx;
126451 start_chunk_idx = chunk_idx_from - overall_chunk_index;
126452 }
126453 if (chunk_idx_to >= overall_chunk_index && chunk_idx_to <= overall_chunk_index + segment.ChunkCount()) {
126454 // We end in this segment
126455 end_segment_idx = segment_idx;
126456 end_chunk_idx = chunk_idx_to - overall_chunk_index;
126457 }
126458 overall_chunk_index += segment.ChunkCount();
126459 }
126460
126461 Reset();
126462}
idx_t end_segment_idx
End indices.
Definition duckdb.cpp:124423
void Reset()
Resets the scan indices to the start.
Definition duckdb.cpp:126496
TupleDataCollection & collection
The collection being iterated over.
Definition duckdb.cpp:124415
TupleDataScanState state
Current scan state and scan indices.
Definition duckdb.cpp:124427
idx_t start_segment_idx
Start indices.
Definition duckdb.cpp:124420
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
Here is the call graph for this function:

Member Function Documentation

◆ Done()

bool duckdb::TupleDataChunkIterator::Done ( ) const

Whether the iterator is done.

126469 {
126470 return current_segment_idx == end_segment_idx && current_chunk_idx == end_chunk_idx;
126471}
Here is the caller graph for this function:

◆ Next()

bool duckdb::TupleDataChunkIterator::Next ( )

Fetches the next STANDARD_VECTOR_SIZE row locations (and heap locations/sizes if init_heap is true).

126473 {
126474 D_ASSERT(!Done()); // Check if called after already done
126475
126476 // Set the next indices and checks if we're at the end of the collection
126477 // NextScanIndex can go past this iterators 'end', so we have to check the indices again
126478 const auto segment_idx_before = current_segment_idx;
126479 if (!collection.NextScanIndex(state, current_segment_idx, current_chunk_idx) || Done()) {
126480 // Drop pins / stores them if TupleDataPinProperties::KEEP_EVERYTHING_PINNED
126481 collection.FinalizePinState(state.pin_state, *collection.segments[segment_idx_before]);
126482 current_segment_idx = end_segment_idx;
126483 current_chunk_idx = end_chunk_idx;
126484 return false;
126485 }
126486
126487 // Finalize pin state when moving from one segment to the next
126488 if (current_segment_idx != segment_idx_before) {
126489 collection.FinalizePinState(state.pin_state, *collection.segments[segment_idx_before]);
126490 }
126491
126493 return true;
126494}
bool Done() const
Whether the iterator is done.
Definition duckdb.cpp:126469
void InitializeCurrentChunk()
Initializes the row locations (and heap locations/sizes if init_heap is true) at the current scan ind...
Definition duckdb.cpp:126464
Here is the call graph for this function:

◆ Reset()

void duckdb::TupleDataChunkIterator::Reset ( )

Resets the scan indices to the start.

126496 {
126497 state.segment_index = start_segment_idx;
126498 state.chunk_index = start_chunk_idx;
126499 collection.NextScanIndex(state, current_segment_idx, current_chunk_idx);
126501}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCurrentChunkCount()

idx_t duckdb::TupleDataChunkIterator::GetCurrentChunkCount ( ) const

Get the count of the current "DataChunk".

126503 {
126504 return collection.segments[current_segment_idx]->chunks[current_chunk_idx]->count;
126505}

◆ GetChunkState()

TupleDataChunkState & duckdb::TupleDataChunkIterator::GetChunkState ( )

Get the Chunk state of the scan state of this iterator.

126507 {
126508 return state.chunk_state;
126509}

◆ GetRowLocations()

data_ptr_t * duckdb::TupleDataChunkIterator::GetRowLocations ( )

Get the array holding the row locations.

126511 {
126512 return FlatVector::GetData<data_ptr_t>(state.chunk_state.row_locations);
126513}

◆ GetHeapLocations()

data_ptr_t * duckdb::TupleDataChunkIterator::GetHeapLocations ( )

Get the array holding the heap locations.

126515 {
126516 return FlatVector::GetData<data_ptr_t>(state.chunk_state.heap_locations);
126517}

◆ GetHeapSizes()

idx_t * duckdb::TupleDataChunkIterator::GetHeapSizes ( )

Get the array holding the heap sizes.

126519 {
126520 return FlatVector::GetData<idx_t>(state.chunk_state.heap_sizes);
126521}

◆ InitializeCurrentChunk()

void duckdb::TupleDataChunkIterator::InitializeCurrentChunk ( )
private

Initializes the row locations (and heap locations/sizes if init_heap is true) at the current scan indices.

126464 {
126465 auto &segment = *collection.segments[current_segment_idx];
126466 segment.allocator->InitializeChunkState(segment, state.pin_state, state.chunk_state, current_chunk_idx, init_heap);
126467}
Here is the caller graph for this function:

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