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::InsertionOrderPreservingMap< V > Class Template Reference
Collaboration diagram for duckdb::InsertionOrderPreservingMap< V >:

Public Types

typedef vector< pair< string, V > > VECTOR_TYPE
 
typedef string key_type
 

Public Member Functions

vector< string > Keys () const
 
VECTOR_TYPE::iterator begin ()
 
VECTOR_TYPE::iterator end ()
 
VECTOR_TYPE::const_iterator begin () const
 
VECTOR_TYPE::const_iterator end () const
 
VECTOR_TYPE::reverse_iterator rbegin ()
 
VECTOR_TYPE::reverse_iterator rend ()
 
VECTOR_TYPE::iterator find (const string &key)
 
VECTOR_TYPE::const_iterator find (const string &key) const
 
idx_t size () const
 
bool empty () const
 
void resize (idx_t nz)
 
void clear ()
 
void insert (const string &key, V &&value)
 
void insert (const string &key, const V &value)
 
void insert (pair< string, V > &&value)
 
void erase (typename VECTOR_TYPE::iterator it)
 
bool contains (const string &key) const
 
const Vat (const string &key) const
 
Voperator[] (const string &key)
 
bool operator== (const InsertionOrderPreservingMap &other) const
 
bool operator!= (const InsertionOrderPreservingMap &other) const
 

Private Attributes

VECTOR_TYPE map
 
case_insensitive_map_t< idx_tmap_idx
 

Constructor & Destructor Documentation

◆ InsertionOrderPreservingMap()

template<typename V >
duckdb::InsertionOrderPreservingMap< V >::InsertionOrderPreservingMap ( )
inline
5499 {
5500 }

Member Function Documentation

◆ Keys()

template<typename V >
vector< string > duckdb::InsertionOrderPreservingMap< V >::Keys ( ) const
inline
5507 {
5508 vector<string> keys;
5509 keys.resize(this->size());
5510 for (auto &kv : map_idx) {
5511 keys[kv.second] = kv.first;
5512 }
5513
5514 return keys;
5515 }

◆ begin() [1/2]

template<typename V >
VECTOR_TYPE::iterator duckdb::InsertionOrderPreservingMap< V >::begin ( )
inline
5517 { // NOLINT: match stl API
5518 return map.begin();
5519 }

◆ end() [1/2]

template<typename V >
VECTOR_TYPE::iterator duckdb::InsertionOrderPreservingMap< V >::end ( )
inline
5521 { // NOLINT: match stl API
5522 return map.end();
5523 }

◆ begin() [2/2]

template<typename V >
VECTOR_TYPE::const_iterator duckdb::InsertionOrderPreservingMap< V >::begin ( ) const
inline
5525 { // NOLINT: match stl API
5526 return map.begin();
5527 }

◆ end() [2/2]

template<typename V >
VECTOR_TYPE::const_iterator duckdb::InsertionOrderPreservingMap< V >::end ( ) const
inline
5529 { // NOLINT: match stl API
5530 return map.end();
5531 }

◆ rbegin()

template<typename V >
VECTOR_TYPE::reverse_iterator duckdb::InsertionOrderPreservingMap< V >::rbegin ( )
inline
5533 { // NOLINT: match stl API
5534 return map.rbegin();
5535 }

◆ rend()

template<typename V >
VECTOR_TYPE::reverse_iterator duckdb::InsertionOrderPreservingMap< V >::rend ( )
inline
5537 { // NOLINT: match stl API
5538 return map.rend();
5539 }

◆ find() [1/2]

template<typename V >
VECTOR_TYPE::iterator duckdb::InsertionOrderPreservingMap< V >::find ( const string &  key)
inline
5541 { // NOLINT: match stl API
5542 auto entry = map_idx.find(key);
5543 if (entry == map_idx.end()) {
5544 return map.end();
5545 }
5546 return map.begin() + static_cast<typename VECTOR_TYPE::difference_type>(entry->second);
5547 }

◆ find() [2/2]

template<typename V >
VECTOR_TYPE::const_iterator duckdb::InsertionOrderPreservingMap< V >::find ( const string &  key) const
inline
5549 { // NOLINT: match stl API
5550 auto entry = map_idx.find(key);
5551 if (entry == map_idx.end()) {
5552 return map.end();
5553 }
5554 return map.begin() + static_cast<typename VECTOR_TYPE::difference_type>(entry->second);
5555 }

◆ size()

template<typename V >
idx_t duckdb::InsertionOrderPreservingMap< V >::size ( ) const
inline
5557 { // NOLINT: match stl API
5558 return map_idx.size();
5559 }

◆ empty()

template<typename V >
bool duckdb::InsertionOrderPreservingMap< V >::empty ( ) const
inline
5561 { // NOLINT: match stl API
5562 return map_idx.empty();
5563 }

◆ resize()

template<typename V >
void duckdb::InsertionOrderPreservingMap< V >::resize ( idx_t  nz)
inline
5565 { // NOLINT: match stl API
5566 map.resize(nz);
5567 }

◆ clear()

template<typename V >
void duckdb::InsertionOrderPreservingMap< V >::clear ( )
inline
5569 { // NOLINT: match stl API
5570 map.clear();
5571 }

◆ insert() [1/3]

template<typename V >
void duckdb::InsertionOrderPreservingMap< V >::insert ( const string &  key,
V &&  value 
)
inline
5573 { // NOLINT: match stl API
5574 if (contains(key)) {
5575 return;
5576 }
5577 map.emplace_back(key, std::move(value));
5578 map_idx[key] = map.size() - 1;
5579 }

◆ insert() [2/3]

template<typename V >
void duckdb::InsertionOrderPreservingMap< V >::insert ( const string &  key,
const V value 
)
inline
5581 { // NOLINT: match stl API
5582 if (contains(key)) {
5583 return;
5584 }
5585 map.emplace_back(key, value);
5586 map_idx[key] = map.size() - 1;
5587 }

◆ insert() [3/3]

template<typename V >
void duckdb::InsertionOrderPreservingMap< V >::insert ( pair< string, V > &&  value)
inline
5589 { // NOLINT: match stl API
5590 auto &key = value.first;
5591 if (contains(key)) {
5592 return;
5593 }
5594 map_idx[key] = map.size();
5595 map.push_back(std::move(value));
5596 }

◆ erase()

template<typename V >
void duckdb::InsertionOrderPreservingMap< V >::erase ( typename VECTOR_TYPE::iterator  it)
inline
5598 { // NOLINT: match stl API
5599 auto key = it->first;
5600 auto idx = map_idx[key];
5601 map.erase(it);
5602 map_idx.erase(key);
5603 for (auto &kv : map_idx) {
5604 if (kv.second > idx) {
5605 kv.second--;
5606 }
5607 }
5608 }

◆ contains()

template<typename V >
bool duckdb::InsertionOrderPreservingMap< V >::contains ( const string &  key) const
inline
5610 { // NOLINT: match stl API
5611 return map_idx.find(key) != map_idx.end();
5612 }

◆ at()

template<typename V >
const V & duckdb::InsertionOrderPreservingMap< V >::at ( const string &  key) const
inline
5614 { // NOLINT: match stl API
5615 return map[map_idx.at(key)].second;
5616 }

◆ operator[]()

template<typename V >
V & duckdb::InsertionOrderPreservingMap< V >::operator[] ( const string &  key)
inline
5618 {
5619 if (!contains(key)) {
5620 auto v = V();
5621 insert(key, std::move(v));
5622 }
5623 return map[map_idx[key]].second;
5624 }
uint32_t v

◆ operator==()

template<typename V >
bool duckdb::InsertionOrderPreservingMap< V >::operator== ( const InsertionOrderPreservingMap< V > &  other) const
inline
5626 {
5627 return map == other.map && map_idx == other.map_idx;
5628 }

◆ operator!=()

5630 {
5631 return !(*this == other);
5632 }

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