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::optional_idx Class Reference

Public Member Functions

 optional_idx (idx_t index)
 
bool IsValid () const
 
void SetInvalid ()
 
idx_t GetIndex () const
 
bool operator== (const optional_idx &rhs) const
 
bool operator!= (const optional_idx &rhs) const
 

Static Public Member Functions

static optional_idx Invalid ()
 

Private Attributes

idx_t index
 

Static Private Attributes

static constexpr const idx_t INVALID_INDEX = idx_t(-1)
 

Constructor & Destructor Documentation

◆ optional_idx() [1/2]

duckdb::optional_idx::optional_idx ( )
inline
2570 : index(INVALID_INDEX) {
2571 }

◆ optional_idx() [2/2]

duckdb::optional_idx::optional_idx ( idx_t  index)
inline
2572 : index(index) { // NOLINT: allow implicit conversion from idx_t
2573 if (index == INVALID_INDEX) {
2574 throw InternalException("optional_idx cannot be initialized with an invalid index");
2575 }
2576 }

Member Function Documentation

◆ Invalid()

static optional_idx duckdb::optional_idx::Invalid ( )
inlinestatic
2578 {
2579 return optional_idx();
2580 }

◆ IsValid()

bool duckdb::optional_idx::IsValid ( ) const
inline
2582 {
2583 return index != INVALID_INDEX;
2584 }

◆ SetInvalid()

void duckdb::optional_idx::SetInvalid ( )
inline
2586 {
2587 index = INVALID_INDEX;
2588 }

◆ GetIndex()

idx_t duckdb::optional_idx::GetIndex ( ) const
inline
2590 {
2591 if (index == INVALID_INDEX) {
2592 throw InternalException("Attempting to get the index of an optional_idx that is not set");
2593 }
2594 return index;
2595 }

◆ operator==()

bool duckdb::optional_idx::operator== ( const optional_idx rhs) const
inline
2597 {
2598 return index == rhs.index;
2599 }

◆ operator!=()

bool duckdb::optional_idx::operator!= ( const optional_idx rhs) const
inline
2601 {
2602 return index != rhs.index;
2603 }

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