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::block_iterator_t< STATE, T > Class Template Reference

Iterator for data spread out over multiple blocks. More...

Public Types

using iterator_category = std::random_access_iterator_tag
 
using value_type = T
 
using pointer = value_type *
 
using reference = value_type &
 
using difference_type = idx_t
 
using traits = std::iterator_traits< block_iterator_t >
 

Public Member Functions

 block_iterator_t (STATE &state_p)
 
 block_iterator_t (STATE &state_p, const idx_t &index)
 
 block_iterator_t (STATE &state_p, const idx_t &block_idx_p, const idx_t &tuple_idx_p)
 
 block_iterator_t (const block_iterator_t &other)
 
block_iterator_toperator= (const block_iterator_t &other)
 
reference operator* () const
 (De-)referencing
 
pointer operator-> () const
 
block_iterator_toperator++ ()
 Prefix and postfix increment and decrement.
 
block_iterator_t operator++ (int)
 
block_iterator_toperator-- ()
 
block_iterator_t operator-- (int)
 
block_iterator_toperator+= (const difference_type &n)
 Random access.
 
block_iterator_toperator-= (const difference_type &n)
 
block_iterator_t operator+ (const difference_type &n) const
 
block_iterator_t operator- (const difference_type &n) const
 
reference operator[] (const difference_type &n) const
 
difference_type operator- (const block_iterator_t &other) const
 Difference between iterators.
 
bool operator== (const block_iterator_t &other) const
 Comparison operators.
 
bool operator!= (const block_iterator_t &other) const
 
bool operator< (const block_iterator_t &other) const
 
bool operator> (const block_iterator_t &other) const
 
bool operator<= (const block_iterator_t &other) const
 
bool operator>= (const block_iterator_t &other) const
 

Private Attributes

STATEstate
 
idx_t block_or_chunk_idx
 
idx_t tuple_idx
 

Detailed Description

template<class STATE, class T>
class duckdb::block_iterator_t< STATE, T >

Iterator for data spread out over multiple blocks.

Constructor & Destructor Documentation

◆ block_iterator_t() [1/5]

template<class STATE , class T >
duckdb::block_iterator_t< STATE, T >::block_iterator_t ( STATE state_p)
inlineexplicit
57256 : state(&state_p), block_or_chunk_idx(0), tuple_idx(0) {
57257 }

◆ block_iterator_t() [2/5]

template<class STATE , class T >
duckdb::block_iterator_t< STATE, T >::block_iterator_t ( )
inlineexplicit
57260 : state(nullptr), block_or_chunk_idx(DConstants::INVALID_INDEX), tuple_idx(DConstants::INVALID_INDEX) {
57261 // Ideally, we wouldn't have a default constructor, because we always need a state.
57262 // However, some sorting algorithms use the default constructor before initializing, so we need this
57263 }
static constexpr const idx_t INVALID_INDEX
The value used to signify an invalid index entry.
Definition duckdb.hpp:1117

◆ block_iterator_t() [3/5]

template<class STATE , class T >
duckdb::block_iterator_t< STATE, T >::block_iterator_t ( STATE state_p,
const idx_t index 
)
inline
57265 : state(&state_p) { // NOLINT: uninitialized on purpose
57266 state->RandomAccess(block_or_chunk_idx, tuple_idx, index);
57267 }

◆ block_iterator_t() [4/5]

template<class STATE , class T >
duckdb::block_iterator_t< STATE, T >::block_iterator_t ( STATE state_p,
const idx_t block_idx_p,
const idx_t tuple_idx_p 
)
inline
57270 : state(&state_p), block_or_chunk_idx(block_idx_p), tuple_idx(tuple_idx_p) {
57271 }

◆ block_iterator_t() [5/5]

template<class STATE , class T >
duckdb::block_iterator_t< STATE, T >::block_iterator_t ( const block_iterator_t< STATE, T > &  other)
inline
57274 : state(other.state), block_or_chunk_idx(other.block_or_chunk_idx), tuple_idx(other.tuple_idx) {
57275 }

Member Function Documentation

◆ operator=()

template<class STATE , class T >
block_iterator_t & duckdb::block_iterator_t< STATE, T >::operator= ( const block_iterator_t< STATE, T > &  other)
inline
57277 {
57278 D_ASSERT(!state || RefersToSameObject(*state, *other.state));
57279 if (this != &other) { // This check is needed to shut clang-tidy up
57280 block_or_chunk_idx = other.block_or_chunk_idx;
57281 tuple_idx = other.tuple_idx;
57282 }
57283 return *this;
57284 }
bool RefersToSameObject(const reference< T > &a, const reference< T > &b)
Returns whether or not two reference wrappers refer to the same object.
Definition duckdb.hpp:2191

◆ operator*()

template<class STATE , class T >
reference duckdb::block_iterator_t< STATE, T >::operator* ( ) const
inline

(De-)referencing

57288 {
57289 return state->template GetValueAtIndex<T>(block_or_chunk_idx, tuple_idx);
57290 }

◆ operator->()

template<class STATE , class T >
pointer duckdb::block_iterator_t< STATE, T >::operator-> ( ) const
inline
57291 {
57292 return &operator*();
57293 }
reference operator*() const
(De-)referencing
Definition duckdb.cpp:57288

◆ operator++() [1/2]

template<class STATE , class T >
block_iterator_t & duckdb::block_iterator_t< STATE, T >::operator++ ( )
inline

Prefix and postfix increment and decrement.

57296 {
57297 state->Increment(block_or_chunk_idx, tuple_idx);
57298 return *this;
57299 }

◆ operator++() [2/2]

template<class STATE , class T >
block_iterator_t duckdb::block_iterator_t< STATE, T >::operator++ ( int  )
inline
57300 {
57301 block_iterator_t tmp = *this;
57302 ++(*this);
57303 return tmp;
57304 }

◆ operator--() [1/2]

template<class STATE , class T >
block_iterator_t & duckdb::block_iterator_t< STATE, T >::operator-- ( )
inline
57305 {
57306 state->Decrement(block_or_chunk_idx, tuple_idx);
57307 return *this;
57308 }

◆ operator--() [2/2]

template<class STATE , class T >
block_iterator_t duckdb::block_iterator_t< STATE, T >::operator-- ( int  )
inline
57309 {
57310 block_iterator_t tmp = *this;
57311 --(*this);
57312 return tmp;
57313 }

◆ operator+=()

template<class STATE , class T >
block_iterator_t & duckdb::block_iterator_t< STATE, T >::operator+= ( const difference_type &  n)
inline

Random access.

57316 {
57317 state->Add(block_or_chunk_idx, tuple_idx, n);
57318 return *this;
57319 }

◆ operator-=()

template<class STATE , class T >
block_iterator_t & duckdb::block_iterator_t< STATE, T >::operator-= ( const difference_type &  n)
inline
57320 {
57321 state->Subtract(block_or_chunk_idx, tuple_idx, n);
57322 return *this;
57323 }

◆ operator+()

template<class STATE , class T >
block_iterator_t duckdb::block_iterator_t< STATE, T >::operator+ ( const difference_type &  n) const
inline
57324 {
57325 idx_t new_block_or_chunk_idx = block_or_chunk_idx;
57326 idx_t new_tuple_idx = tuple_idx;
57327 state->Add(new_block_or_chunk_idx, new_tuple_idx, n);
57328 return block_iterator_t(*state, new_block_or_chunk_idx, new_tuple_idx);
57329 }

◆ operator-() [1/2]

template<class STATE , class T >
block_iterator_t duckdb::block_iterator_t< STATE, T >::operator- ( const difference_type &  n) const
inline
57330 {
57331 idx_t new_block_or_chunk_idx = block_or_chunk_idx;
57332 idx_t new_tuple_idx = tuple_idx;
57333 state->Subtract(new_block_or_chunk_idx, new_tuple_idx, n);
57334 return block_iterator_t(*state, new_block_or_chunk_idx, new_tuple_idx);
57335 }

◆ operator[]()

template<class STATE , class T >
reference duckdb::block_iterator_t< STATE, T >::operator[] ( const difference_type &  n) const
inline
57337 {
57338 return state->template GetValueAtIndex<T>(n);
57339 }

◆ operator-() [2/2]

template<class STATE , class T >
difference_type duckdb::block_iterator_t< STATE, T >::operator- ( const block_iterator_t< STATE, T > &  other) const
inline

Difference between iterators.

57342 {
57343 return state->GetIndex(block_or_chunk_idx, tuple_idx) -
57344 other.state->GetIndex(other.block_or_chunk_idx, other.tuple_idx);
57345 }

◆ operator==()

template<class STATE , class T >
bool duckdb::block_iterator_t< STATE, T >::operator== ( const block_iterator_t< STATE, T > &  other) const
inline

Comparison operators.

57348 {
57349 return block_or_chunk_idx == other.block_or_chunk_idx && tuple_idx == other.tuple_idx;
57350 }

◆ operator!=()

template<class STATE , class T >
bool duckdb::block_iterator_t< STATE, T >::operator!= ( const block_iterator_t< STATE, T > &  other) const
inline
57351 {
57352 return block_or_chunk_idx != other.block_or_chunk_idx || tuple_idx != other.tuple_idx;
57353 }

◆ operator<()

template<class STATE , class T >
bool duckdb::block_iterator_t< STATE, T >::operator< ( const block_iterator_t< STATE, T > &  other) const
inline
57354 {
57355 return block_or_chunk_idx == other.block_or_chunk_idx ? tuple_idx < other.tuple_idx
57356 : block_or_chunk_idx < other.block_or_chunk_idx;
57357 }

◆ operator>()

template<class STATE , class T >
bool duckdb::block_iterator_t< STATE, T >::operator> ( const block_iterator_t< STATE, T > &  other) const
inline
57358 {
57359 return block_or_chunk_idx == other.block_or_chunk_idx ? tuple_idx > other.tuple_idx
57360 : block_or_chunk_idx > other.block_or_chunk_idx;
57361 }

◆ operator<=()

template<class STATE , class T >
bool duckdb::block_iterator_t< STATE, T >::operator<= ( const block_iterator_t< STATE, T > &  other) const
inline
57362 {
57363 return block_or_chunk_idx == other.block_or_chunk_idx ? tuple_idx <= other.tuple_idx
57364 : block_or_chunk_idx <= other.block_or_chunk_idx;
57365 }

◆ operator>=()

template<class STATE , class T >
bool duckdb::block_iterator_t< STATE, T >::operator>= ( const block_iterator_t< STATE, T > &  other) const
inline
57366 {
57367 return block_or_chunk_idx == other.block_or_chunk_idx ? tuple_idx >= other.tuple_idx
57368 : block_or_chunk_idx >= other.block_or_chunk_idx;
57369 }

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