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

Public Member Functions

bool AllValid () const
 
void Initialize (idx_t count, bool initial=true)
 
void InitializeEmpty (idx_t count)
 
idx_t Capacity () const
 
bool RowIsValidUnsafe (idx_t row_idx) const
 
bool RowIsValid (idx_t row_idx) const
 Returns true if a row is valid (i.e. not null), false otherwise.
 
void SetValidUnsafe (idx_t row_idx)
 Same as SetValid, but skips a null check on validity_mask.
 
void SetValid (idx_t row_idx)
 Marks the entry at the specified row index as valid (i.e. not-null)
 
void Pack (ValidityMask &mask, const idx_t count) const
 

Private Attributes

bool * validity_mask = nullptr
 
unsafe_unique_array< bool > validity_data
 
idx_t capacity = 0
 

Constructor & Destructor Documentation

◆ ValidityArray()

duckdb::ValidityArray::ValidityArray ( )
inline
9313 {
9314 }

Member Function Documentation

◆ AllValid()

bool duckdb::ValidityArray::AllValid ( ) const
inline
9316 {
9317 return !validity_mask;
9318 }

◆ Initialize()

void duckdb::ValidityArray::Initialize ( idx_t  count,
bool  initial = true 
)
inline
9320 {
9321 capacity = count;
9322 validity_data = make_unsafe_uniq_array<bool>(count);
9323 validity_mask = validity_data.get();
9324 memset(validity_mask, initial, sizeof(bool) * count);
9325 }

◆ InitializeEmpty()

void duckdb::ValidityArray::InitializeEmpty ( idx_t  count)
inline
9326 {
9327 capacity = count;
9328 }

◆ Capacity()

idx_t duckdb::ValidityArray::Capacity ( ) const
inline
9330 {
9331 return capacity;
9332 }

◆ RowIsValidUnsafe()

bool duckdb::ValidityArray::RowIsValidUnsafe ( idx_t  row_idx) const
inline

RowIsValidUnsafe should only be used if AllValid() is false: it achieves the same as RowIsValid but skips a not-null check

9336 {
9337 D_ASSERT(validity_mask);
9338 return validity_mask[row_idx];
9339 }
Here is the caller graph for this function:

◆ RowIsValid()

bool duckdb::ValidityArray::RowIsValid ( idx_t  row_idx) const
inline

Returns true if a row is valid (i.e. not null), false otherwise.

9342 {
9343#ifdef DEBUG
9344 if (row_idx >= capacity) {
9345 throw InternalException("ValidityData::RowIsValid - row_idx %d is out-of-range for mask with capacity %llu",
9346 row_idx, capacity);
9347 }
9348#endif
9349 if (!validity_mask) {
9350 return true;
9351 }
9352 return RowIsValidUnsafe(row_idx);
9353 }
bool RowIsValidUnsafe(idx_t row_idx) const
Definition duckdb.hpp:9336
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetValidUnsafe()

void duckdb::ValidityArray::SetValidUnsafe ( idx_t  row_idx)
inline

Same as SetValid, but skips a null check on validity_mask.

9356 {
9357 D_ASSERT(validity_mask);
9358 validity_mask[row_idx] = true;
9359 }
Here is the caller graph for this function:

◆ SetValid()

void duckdb::ValidityArray::SetValid ( idx_t  row_idx)
inline

Marks the entry at the specified row index as valid (i.e. not-null)

9362 {
9363#ifdef DEBUG
9364 if (row_idx >= capacity) {
9365 throw InternalException("ValidityData::SetValid - row_idx %d is out-of-range for mask with capacity %llu",
9366 row_idx, capacity);
9367 }
9368#endif
9369 if (!validity_mask) {
9370 // if AllValid() we don't need to do anything
9371 // the row is already valid
9372 return;
9373 }
9374
9375 SetValidUnsafe(row_idx);
9376 }
void SetValidUnsafe(idx_t row_idx)
Same as SetValid, but skips a null check on validity_mask.
Definition duckdb.hpp:9356
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Pack()

void duckdb::ValidityArray::Pack ( ValidityMask mask,
const idx_t  count 
) const
inline
9378 {
9379 if (AllValid()) {
9380 mask.Reset(count);
9381 return;
9382 }
9383 mask.Initialize(count);
9384
9385 const auto entire_entries = count / ValidityMask::BITS_PER_VALUE;
9386 const auto ragged = count % ValidityMask::BITS_PER_VALUE;
9387 auto bits = mask.GetData();
9388 idx_t row_idx = 0;
9389 for (idx_t i = 0; i < entire_entries; ++i) {
9390 validity_t entry = 0;
9391 for (idx_t j = 0; j < ValidityMask::BITS_PER_VALUE; ++j) {
9392 if (RowIsValidUnsafe(row_idx++)) {
9393 entry |= validity_t(1) << j;
9394 }
9395 }
9396 *bits++ = entry;
9397 }
9398 if (ragged) {
9399 validity_t entry = 0;
9400 for (idx_t j = 0; j < ragged; ++j) {
9401 if (RowIsValidUnsafe(row_idx++)) {
9402 entry |= validity_t(1) << j;
9403 }
9404 }
9405 *bits++ = entry;
9406 }
9407 }
GMat mask(const GMat &src, const GMat &mask)

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