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

Public Member Functions

 WindowCursor (const WindowCollection &paged, column_t col_idx)
 WindowCursor (const WindowCollection &paged, vector< column_t > column_ids)
idx_t Count () const
 The row count of the paged collection.
bool RowIsVisible (idx_t row_idx) const
 Is the scan in range?
sel_t RowOffset (idx_t row_idx) const
 The offset of the row in the given state.
bool Scan ()
 Scan the next chunk.
idx_t Seek (idx_t row_idx)
 Seek to the given row.
bool CellIsNull (idx_t col_idx, idx_t row_idx)
 Check a collection cell for nullity.
template<typename T>
T GetCell (idx_t col_idx, idx_t row_idx)
 Read a typed cell.
void CopyCell (idx_t col_idx, idx_t row_idx, Vector &target, idx_t target_offset)
 Copy a single value.
unique_ptr< WindowCursor > Copy () const

Public Attributes

const WindowCollection & paged
 The pageable data.
ColumnDataScanState state
 The state used for reading the collection.
DataChunk chunk
 The data chunk read into.

Constructor & Destructor Documentation

◆ WindowCursor() [1/2]

duckdb::WindowCursor::WindowCursor ( const WindowCollection & paged,
column_t col_idx )
254857 : WindowCursor(paged, vector<column_t>(1, col_idx)) {
254858}
const WindowCollection & paged
The pageable data.
Definition duckdb.cpp:163536

◆ WindowCursor() [2/2]

duckdb::WindowCursor::WindowCursor ( const WindowCollection & paged,
vector< column_t > column_ids )
254835 : paged(paged) {
254836 D_ASSERT(paged.collections.empty());
254837 D_ASSERT(paged.ranges.empty());
254838 if (column_ids.empty()) {
254839 // For things like COUNT(*) set the state up to contain the whole range
254840 state.segment_index = 0;
254841 state.chunk_index = 0;
254842 state.current_row_index = 0;
254843 state.next_row_index = paged.size();
254845 chunk.SetCapacity(state.next_row_index);
254846 chunk.SetCardinality(state.next_row_index);
254847 return;
254848 } else if (chunk.data.empty()) {
254849 auto &inputs = paged.inputs;
254850 D_ASSERT(inputs.get());
254851 inputs->InitializeScan(state, std::move(column_ids));
254852 inputs->InitializeScanChunk(state, chunk);
254853 }
254854}
ColumnDataScanState state
The state used for reading the collection.
Definition duckdb.cpp:163538
DataChunk chunk
The data chunk read into.
Definition duckdb.cpp:163540
@ ALLOW_ZERO_COPY
Definition duckdb.hpp:18811

Member Function Documentation

◆ Count()

idx_t duckdb::WindowCursor::Count ( ) const
inline

The row count of the paged collection.

163483 {
163484 return paged.size();
163485 }

◆ RowIsVisible()

bool duckdb::WindowCursor::RowIsVisible ( idx_t row_idx) const
inline

Is the scan in range?

163487 {
163488 return (row_idx < state.next_row_index && state.current_row_index <= row_idx);
163489 }
Here is the caller graph for this function:

◆ RowOffset()

sel_t duckdb::WindowCursor::RowOffset ( idx_t row_idx) const
inline

The offset of the row in the given state.

163491 {
163492 D_ASSERT(RowIsVisible(row_idx));
163493 return UnsafeNumericCast<sel_t>(row_idx - state.current_row_index);
163494 }
bool RowIsVisible(idx_t row_idx) const
Is the scan in range?
Definition duckdb.cpp:163487
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Scan()

bool duckdb::WindowCursor::Scan ( )
inline

Scan the next chunk.

163496 {
163497 return paged.inputs->Scan(state, chunk);
163498 }
Here is the caller graph for this function:

◆ Seek()

idx_t duckdb::WindowCursor::Seek ( idx_t row_idx)
inline

Seek to the given row.

163500 {
163501 if (!RowIsVisible(row_idx)) {
163502 D_ASSERT(paged.inputs.get());
163503 paged.inputs->Seek(row_idx, state, chunk);
163504 }
163505 return RowOffset(row_idx);
163506 }
sel_t RowOffset(idx_t row_idx) const
The offset of the row in the given state.
Definition duckdb.cpp:163491
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CellIsNull()

bool duckdb::WindowCursor::CellIsNull ( idx_t col_idx,
idx_t row_idx )
inline

Check a collection cell for nullity.

163508 {
163509 D_ASSERT(chunk.ColumnCount() > col_idx);
163510 auto index = Seek(row_idx);
163511 auto &source = chunk.data[col_idx];
163512 return FlatVector::IsNull(source, index);
163513 }
idx_t Seek(idx_t row_idx)
Seek to the given row.
Definition duckdb.cpp:163500
index
Here is the call graph for this function:

◆ GetCell()

template<typename T>
T duckdb::WindowCursor::GetCell ( idx_t col_idx,
idx_t row_idx )
inline

Read a typed cell.

163516 {
163517 D_ASSERT(chunk.ColumnCount() > col_idx);
163518 auto index = Seek(row_idx);
163519 auto &source = chunk.data[col_idx];
163520 const auto data = FlatVector::GetData<T>(source);
163521 return data[index];
163522 }
Here is the call graph for this function:

◆ CopyCell()

void duckdb::WindowCursor::CopyCell ( idx_t col_idx,
idx_t row_idx,
Vector & target,
idx_t target_offset )
inline

Copy a single value.

163524 {
163525 D_ASSERT(chunk.ColumnCount() > col_idx);
163526 auto index = Seek(row_idx);
163527 auto &source = chunk.data[col_idx];
163528 VectorOperations::Copy(source, target, index + 1, index, target_offset);
163529 }
Here is the call graph for this function:

◆ Copy()

unique_ptr< WindowCursor > duckdb::WindowCursor::Copy ( ) const
inline
163531 {
163532 return make_uniq<WindowCursor>(paged, state.column_ids);
163533 }

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