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::fixed_size_map_iterator< T, is_const > Class Template Reference

Public Types

using key_type = idx_t
 
using mapped_type = T
 
using fixed_size_map_type = fixed_size_map_t< mapped_type >
 
using map_type = typename std::conditional< is_const, const fixed_size_map_type, fixed_size_map_type >::type
 
using occupied_mask = typename fixed_size_map_t< mapped_type >::occupied_mask
 

Public Member Functions

 fixed_size_map_iterator (map_type &map_p, key_type index)
 
fixed_size_map_iteratoroperator++ ()
 
fixed_size_map_iterator operator++ (int)
 
key_type GetKey () const
 
mapped_type & GetValue ()
 
const mapped_type & GetValue () const
 

Private Member Functions

void NextEntry ()
 

Private Attributes

map_type & map
 
idx_t entry_idx
 
idx_t idx_in_entry
 

Friends

bool operator== (const fixed_size_map_iterator &a, const fixed_size_map_iterator &b)
 
bool operator!= (const fixed_size_map_iterator &a, const fixed_size_map_iterator &b)
 
bool operator< (const fixed_size_map_iterator &a, const fixed_size_map_iterator &b)
 

Constructor & Destructor Documentation

◆ fixed_size_map_iterator()

template<class T , bool is_const>
duckdb::fixed_size_map_iterator< T, is_const >::fixed_size_map_iterator ( map_type &  map_p,
key_type  index 
)
inline
46604 : map(map_p) {
46605 occupied_mask::GetEntryIndex(index, entry_idx, idx_in_entry);
46606 }

Member Function Documentation

◆ operator++() [1/2]

template<class T , bool is_const>
fixed_size_map_iterator & duckdb::fixed_size_map_iterator< T, is_const >::operator++ ( )
inline
46608 {
46609 // Prefix increment
46610 if (++idx_in_entry == occupied_mask::BITS_PER_VALUE) {
46611 NextEntry();
46612 }
46613 // Loop until we find an occupied index, or until the end
46614 auto end = map.end();
46615 while (*this < end) {
46616 const auto &entry = map.occupied.GetValidityEntryUnsafe(entry_idx);
46617 if (entry == static_cast<uint8_t>(~occupied_mask::ValidityBuffer::MAX_ENTRY)) {
46618 // Entire entry is unoccupied, skip
46619 if (entry_idx == end.entry_idx) {
46620 // This is the last entry
46621 idx_in_entry = end.idx_in_entry;
46622 break;
46623 }
46624 NextEntry();
46625 } else {
46626 // One or more occupied in entry, loop over it
46627 const auto idx_to = entry_idx == end.entry_idx ? end.idx_in_entry : occupied_mask::BITS_PER_VALUE;
46628 for (; idx_in_entry < idx_to; idx_in_entry++) {
46629 if (map.occupied.RowIsValid(entry, idx_in_entry)) {
46630 // We found an occupied index
46631 return *this;
46632 }
46633 }
46634 // We did not find an occupied index
46635 if (*this != end) {
46636 NextEntry();
46637 }
46638 }
46639 }
46640 return *this;
46641 }
::uint8_t uint8_t

◆ operator++() [2/2]

template<class T , bool is_const>
fixed_size_map_iterator duckdb::fixed_size_map_iterator< T, is_const >::operator++ ( int  )
inline
46643 {
46644 fixed_size_map_iterator tmp = *this;
46645 ++(*this);
46646 return tmp;
46647 }

◆ GetKey()

template<class T , bool is_const>
key_type duckdb::fixed_size_map_iterator< T, is_const >::GetKey ( ) const
inline
46649 {
46650 return entry_idx * occupied_mask::BITS_PER_VALUE + idx_in_entry;
46651 }

◆ GetValue() [1/2]

template<class T , bool is_const>
mapped_type & duckdb::fixed_size_map_iterator< T, is_const >::GetValue ( )
inline
46653 {
46654 return map.values[GetKey()];
46655 }

◆ GetValue() [2/2]

template<class T , bool is_const>
const mapped_type & duckdb::fixed_size_map_iterator< T, is_const >::GetValue ( ) const
inline
46657 {
46658 return map.values[GetKey()];
46659 }

◆ NextEntry()

template<class T , bool is_const>
void duckdb::fixed_size_map_iterator< T, is_const >::NextEntry ( )
inlineprivate
46680 {
46681 entry_idx++;
46682 idx_in_entry = 0;
46683 }

Friends And Related Symbol Documentation

◆ operator==

template<class T , bool is_const>
bool operator== ( const fixed_size_map_iterator< T, is_const > &  a,
const fixed_size_map_iterator< T, is_const > &  b 
)
friend
46661 {
46662 return a.entry_idx == b.entry_idx && a.idx_in_entry == b.idx_in_entry;
46663 }

◆ operator!=

template<class T , bool is_const>
bool operator!= ( const fixed_size_map_iterator< T, is_const > &  a,
const fixed_size_map_iterator< T, is_const > &  b 
)
friend
46665 {
46666 return !(a == b);
46667 }

◆ operator<

template<class T , bool is_const>
bool operator< ( const fixed_size_map_iterator< T, is_const > &  a,
const fixed_size_map_iterator< T, is_const > &  b 
)
friend
46669 {
46670 if (a.entry_idx < b.entry_idx) {
46671 return true;
46672 }
46673 if (a.entry_idx == b.entry_idx) {
46674 return a.idx_in_entry < b.idx_in_entry;
46675 }
46676 return false;
46677 }

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