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

Public Member Functions

shared_ptr< LocalTableStorage > MoveEntry (DataTable &table)
reference_map_t< DataTable, shared_ptr< LocalTableStorage > > MoveEntries ()
optional_ptr< LocalTableStorage > GetStorage (DataTable &table) const
LocalTableStorage & GetOrCreateStorage (ClientContext &context, DataTable &table)
idx_t EstimatedSize () const
bool IsEmpty () const
void InsertEntry (DataTable &table, shared_ptr< LocalTableStorage > entry)

Private Attributes

mutex table_storage_lock
reference_map_t< DataTable, shared_ptr< LocalTableStorage > > table_storage

Member Function Documentation

◆ MoveEntry()

shared_ptr< LocalTableStorage > duckdb::LocalTableManager::MoveEntry ( DataTable & table)
413796 {
413797 lock_guard<mutex> l(table_storage_lock);
413798 auto entry = table_storage.find(table);
413799 if (entry == table_storage.end()) {
413800 return nullptr;
413801 }
413802 auto storage_entry = std::move(entry->second);
413803 table_storage.erase(entry);
413804 return storage_entry;
413805}

◆ MoveEntries()

reference_map_t< DataTable, shared_ptr< LocalTableStorage > > duckdb::LocalTableManager::MoveEntries ( )
413807 {
413808 lock_guard<mutex> l(table_storage_lock);
413809 return std::move(table_storage);
413810}

◆ GetStorage()

optional_ptr< LocalTableStorage > duckdb::LocalTableManager::GetStorage ( DataTable & table) const
413772 {
413773 lock_guard<mutex> l(table_storage_lock);
413774 auto entry = table_storage.find(table);
413775 return entry == table_storage.end() ? nullptr : entry->second.get();
413776}

◆ GetOrCreateStorage()

LocalTableStorage & duckdb::LocalTableManager::GetOrCreateStorage ( ClientContext & context,
DataTable & table )
413778 {
413779 lock_guard<mutex> l(table_storage_lock);
413780 auto entry = table_storage.find(table);
413781 if (entry == table_storage.end()) {
413782 auto new_storage = make_shared_ptr<LocalTableStorage>(context, table);
413783 auto storage = new_storage.get();
413784 table_storage.insert(make_pair(reference<DataTable>(table), std::move(new_storage)));
413785 return *storage;
413786 } else {
413787 return *entry->second.get();
413788 }
413789}

◆ EstimatedSize()

idx_t duckdb::LocalTableManager::EstimatedSize ( ) const
413812 {
413813 lock_guard<mutex> l(table_storage_lock);
413814 idx_t estimated_size = 0;
413815 for (auto &storage : table_storage) {
413816 estimated_size += storage.second->EstimatedSize();
413817 }
413818 return estimated_size;
413819}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

◆ IsEmpty()

bool duckdb::LocalTableManager::IsEmpty ( ) const
413791 {
413792 lock_guard<mutex> l(table_storage_lock);
413793 return table_storage.empty();
413794}

◆ InsertEntry()

void duckdb::LocalTableManager::InsertEntry ( DataTable & table,
shared_ptr< LocalTableStorage > entry )
413821 {
413822 lock_guard<mutex> l(table_storage_lock);
413823 D_ASSERT(table_storage.find(table) == table_storage.end());
413824 table_storage[table] = std::move(entry);
413825}

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