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::TupleDataChunk Struct Reference
Collaboration diagram for duckdb::TupleDataChunk:

Public Member Functions

 TupleDataChunk (mutex &lock_p)
 TupleDataChunk (const TupleDataChunk &other)=delete
 Disable copy constructors.
TupleDataChunk & operator= (const TupleDataChunk &)=delete
 TupleDataChunk (TupleDataChunk &&other) noexcept
 Enable move constructors.
TupleDataChunk & operator= (TupleDataChunk &&) noexcept
TupleDataChunkPart & AddPart (TupleDataSegment &segment, unsafe_arena_ptr< TupleDataChunkPart > part_ptr)
 Add a part to this chunk.
void MergeLastChunkPart (TupleDataSegment &segment)
 Tries to merge the last chunk part into the second-to-last one.
void Verify (const TupleDataSegment &segment) const
 Verify counts of the parts in this chunk.

Public Attributes

ContinuousIdSet part_ids
 The parts of this chunk.
ContinuousIdSet row_block_ids
 The row block ids referenced by the chunk.
ContinuousIdSet heap_block_ids
 The heap block ids referenced by the chunk.
idx_t count
 Tuple count for this chunk.
reference< mutex > lock
 Lock for recomputing heap pointers.

Constructor & Destructor Documentation

◆ TupleDataChunk() [1/2]

duckdb::TupleDataChunk::TupleDataChunk ( mutex & lock_p)
explicit
128738 : count(0), lock(lock_p) {
128739}
reference< mutex > lock
Lock for recomputing heap pointers.
Definition duckdb.cpp:56528
idx_t count
Tuple count for this chunk.
Definition duckdb.cpp:56526

◆ TupleDataChunk() [2/2]

duckdb::TupleDataChunk::TupleDataChunk ( TupleDataChunk && other)
noexcept

Enable move constructors.

128749 : count(0), lock(other.lock) {
128750 SwapTupleDataChunk(*this, other);
128751}

Member Function Documentation

◆ operator=()

TupleDataChunk & duckdb::TupleDataChunk::operator= ( TupleDataChunk && other)
noexcept
128753 {
128754 SwapTupleDataChunk(*this, other);
128755 return *this;
128756}

◆ AddPart()

TupleDataChunkPart & duckdb::TupleDataChunk::AddPart ( TupleDataSegment & segment,
unsafe_arena_ptr< TupleDataChunkPart > part_ptr )

Add a part to this chunk.

128758 {
128759 auto &part = *part_ptr;
128760 count += part.count;
128761 row_block_ids.Insert(part.row_block_index);
128762 if (!segment.layout.AllConstant() && part.total_heap_size > 0) {
128763 heap_block_ids.Insert(part.heap_block_index);
128764 }
128765 part.lock = lock;
128766 part_ids.Insert(UnsafeNumericCast<uint32_t>(segment.chunk_parts.size()));
128767 segment.chunk_parts.emplace_back(std::move(part_ptr));
128768 return part;
128769}
ContinuousIdSet row_block_ids
The row block ids referenced by the chunk.
Definition duckdb.cpp:56522
ContinuousIdSet part_ids
The parts of this chunk.
Definition duckdb.cpp:56519
ContinuousIdSet heap_block_ids
The heap block ids referenced by the chunk.
Definition duckdb.cpp:56524
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MergeLastChunkPart()

void duckdb::TupleDataChunk::MergeLastChunkPart ( TupleDataSegment & segment)

Tries to merge the last chunk part into the second-to-last one.

128782 {
128783 if (part_ids.Size() < 2) {
128784 return;
128785 }
128786
128787 auto &second_to_last = *segment.chunk_parts[part_ids.End() - 2];
128788 auto &last = *segment.chunk_parts[part_ids.End() - 1];
128789
128790 auto rows_align =
128791 last.row_block_index == second_to_last.row_block_index &&
128792 last.row_block_offset == second_to_last.row_block_offset + second_to_last.count * segment.layout.GetRowWidth();
128793
128794 if (!rows_align) { // If rows don't align we can never merge
128795 return;
128796 }
128797
128798 if (segment.layout.AllConstant()) { // No heap and rows align - merge
128799 second_to_last.count += last.count;
128800 if (segment.chunk_parts.size() == part_ids.End()) {
128801 // Can only remove if the part we're merging was the last added chunk part
128802 // If not, we just leave it there (no chunk will reference it anyway)
128803 segment.chunk_parts.pop_back();
128804 }
128805 part_ids.DecrementMax();
128806 return;
128807 }
128808
128809 if (last.heap_block_index == second_to_last.heap_block_index &&
128810 last.heap_block_offset == second_to_last.heap_block_index + second_to_last.total_heap_size &&
128811 last.base_heap_ptr == second_to_last.base_heap_ptr) { // There is a heap and it aligns - merge
128812 second_to_last.total_heap_size += last.total_heap_size;
128813 second_to_last.count += last.count;
128814 if (segment.chunk_parts.size() == part_ids.End()) {
128815 segment.chunk_parts.pop_back(); // Same as above
128816 }
128817 part_ids.DecrementMax();
128818 }
128819}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Verify()

void duckdb::TupleDataChunk::Verify ( const TupleDataSegment & segment) const

Verify counts of the parts in this chunk.

128771 {
128772#ifdef D_ASSERT_IS_ENABLED
128773 idx_t total_count = 0;
128774 for (auto part_id = part_ids.Start(); part_id < part_ids.End(); part_id++) {
128775 total_count += segment.chunk_parts[part_id]->count;
128776 }
128777 D_ASSERT(this->count == total_count);
128778 D_ASSERT(this->count <= STANDARD_VECTOR_SIZE);
128779#endif
128780}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
Here is the caller graph for this function:

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