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::buffer_handle_map_t Class Reference
Collaboration diagram for duckdb::buffer_handle_map_t:

Public Member Functions

pair< iterator, bool > emplace (const uint32_t &id, BufferHandle &&handle)
 
iterator erase (const iterator &it)
 
iterator find (const uint32_t &id)
 
iterator begin ()
 
iterator end ()
 
void clear ()
 
void acquire_handles (vector< BufferHandle > &pins)
 

Private Types

using iterator = unsafe_vector< pair< uint32_t, BufferHandle > >::iterator
 

Private Attributes

unsafe_vector< pair< uint32_t, BufferHandle > > handles
 

Detailed Description

Instead of an unordered_map from uint32 -> BufferHandle, we have a vector. The lookup speed is OK since these maps should be very small. The benefit of this is that we aren't doing any other heap allocations than the one vector. For unordered_map, we would get a heap allocation for every inserted entry.

Constructor & Destructor Documentation

◆ buffer_handle_map_t()

duckdb::buffer_handle_map_t::buffer_handle_map_t ( )
inline
56616 {
56617 }

Member Function Documentation

◆ emplace()

pair< iterator, bool > duckdb::buffer_handle_map_t::emplace ( const uint32_t id,
BufferHandle &&  handle 
)
inline
56620 {
56621 D_ASSERT(find(id) == end()); // Should have been checked by the caller
56622 handles.emplace_back(id, std::move(handle));
56623 return make_pair(--end(), true);
56624 }

◆ erase()

iterator duckdb::buffer_handle_map_t::erase ( const iterator &  it)
inline
56626 {
56627 return handles.erase(it);
56628 }

◆ find()

iterator duckdb::buffer_handle_map_t::find ( const uint32_t id)
inline
56630 {
56631 auto it = handles.begin();
56632 for (; it != handles.end(); it++) {
56633 if (it->first == id) {
56634 break;
56635 }
56636 }
56637 return it;
56638 }

◆ begin()

iterator duckdb::buffer_handle_map_t::begin ( )
inline
56640 {
56641 return handles.begin();
56642 }

◆ end()

iterator duckdb::buffer_handle_map_t::end ( )
inline
56644 {
56645 return handles.end();
56646 }

◆ clear()

void duckdb::buffer_handle_map_t::clear ( )
inline
56648 {
56649 handles.clear();
56650 }

◆ acquire_handles()

void duckdb::buffer_handle_map_t::acquire_handles ( vector< BufferHandle > &  pins)
inline
56652 {
56653 for (auto &handle : handles) {
56654 pins.emplace_back(std::move(handle.second));
56655 }
56656 handles.clear();
56657 }

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