![]() |
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.
|


Classes | |
| struct | TemporaryFileData |
Public Member Functions | |
| StandardBufferManager (DatabaseInstance &db, string temp_directory) | |
| shared_ptr< BlockHandle > | RegisterTransientMemory (const idx_t size, BlockManager &block_manager) final |
| Registers a transient memory buffer. | |
| shared_ptr< BlockHandle > | RegisterSmallMemory (MemoryTag tag, const idx_t size) final |
| idx_t | GetUsedMemory () const final |
| Returns the currently allocated memory. | |
| idx_t | GetMaxMemory () const final |
| Returns the maximum available memory. | |
| idx_t | GetUsedSwap () const final |
| Returns the currently used swap space. | |
| optional_idx | GetMaxSwap () const final |
| Returns the maximum swap space that can be used. | |
| idx_t | GetBlockAllocSize () const final |
| Returns the block allocation size for buffer-managed blocks. | |
| idx_t | GetBlockSize () const final |
| Returns the block size for buffer-managed blocks. | |
| idx_t | GetQueryMaxMemory () const final |
| Returns the maximum available memory for a given query. | |
| DUCKDB_API shared_ptr< BlockHandle > | AllocateTemporaryMemory (MemoryTag tag, idx_t block_size, bool can_destroy=true) final |
| DUCKDB_API shared_ptr< BlockHandle > | AllocateMemory (MemoryTag tag, BlockManager *block_manager, bool can_destroy=true) final |
| Allocate block-based memory. The block manager provides the block size, and the block header size. Returns the BlockHandle managing the registered memory. | |
| DUCKDB_API BufferHandle | Allocate (MemoryTag tag, idx_t block_size, bool can_destroy=true) final |
| Allocate (temporary) memory of size block_size, and pin it. | |
| DUCKDB_API BufferHandle | Allocate (MemoryTag tag, BlockManager *block_manager, bool can_destroy=true) final |
| Allocate block-based memory and pin it. | |
| BufferHandle | Pin (shared_ptr< BlockHandle > &handle) final |
| Pin a block handle. | |
| BufferHandle | Pin (const QueryContext &context, shared_ptr< BlockHandle > &handle) final |
| void | Prefetch (vector< shared_ptr< BlockHandle > > &handles) final |
| Pre-fetch a series of blocks. Using this function is a performance suggestion. | |
| void | Unpin (shared_ptr< BlockHandle > &handle) final |
| Unpin a block handle. | |
| void | SetMemoryLimit (idx_t limit=(idx_t) -1) final |
| void | SetSwapLimit (optional_idx limit=optional_idx()) final |
| Set a new swap limit. | |
| vector< MemoryInformation > | GetMemoryUsageInfo () const override |
| Returns information about memory usage. | |
| BlockManager & | GetTemporaryBlockManager () final |
| Get the block manager used for in-memory data. | |
| vector< TemporaryFileInformation > | GetTemporaryFiles () final |
| Returns a list of all temporary files. | |
| const string & | GetTemporaryDirectory () const final |
| Get the path to the temporary file directory. | |
| void | SetTemporaryDirectory (const string &new_dir) final |
| Set the path to the temporary file directory. | |
| DUCKDB_API Allocator & | GetBufferAllocator () final |
| Get the buffer allocator. | |
| const DatabaseInstance & | GetDatabase () const override |
| Get the const database. | |
| DatabaseInstance & | GetDatabase () override |
| Get the database. | |
| unique_ptr< FileBuffer > | ConstructManagedBuffer (idx_t size, idx_t block_header_size, unique_ptr< FileBuffer > &&source, FileBufferType type=FileBufferType::MANAGED_BUFFER) override |
| Construct a managed buffer. | |
| DUCKDB_API void | ReserveMemory (idx_t size) final |
| Reserve memory. | |
| DUCKDB_API void | FreeReservedMemory (idx_t size) final |
| Free reserved memory. | |
| bool | HasTemporaryDirectory () const final |
| Returns true, if the path to the temporary file directory is not empty. | |
| bool | HasFilesInTemporaryDirectory () const final |
| Returns true if there are files found in the temporary directory. | |
| Public Member Functions inherited from duckdb::BufferManager | |
| virtual shared_ptr< BlockHandle > | RegisterSmallMemory (const idx_t size) |
| Returns a newly registered block of memory that is smaller than the block size setting. | |
Static Public Member Functions | |
| static unique_ptr< StandardBufferManager > | CreateBufferManager (DatabaseInstance &db, string temp_directory) |
| Static Public Member Functions inherited from duckdb::BufferManager | |
| static DUCKDB_API BufferManager & | GetBufferManager (DatabaseInstance &db) |
| static DUCKDB_API const BufferManager & | GetBufferManager (const DatabaseInstance &db) |
| static DUCKDB_API BufferManager & | GetBufferManager (ClientContext &context) |
| static DUCKDB_API const BufferManager & | GetBufferManager (const ClientContext &context) |
| static DUCKDB_API BufferManager & | GetBufferManager (AttachedDatabase &db) |
| static DUCKDB_API idx_t | GetAllocSize (const idx_t alloc_size) |
Protected Member Functions | |
| template<typename... ARGS> | |
| TempBufferPoolReservation | EvictBlocksOrThrow (MemoryTag tag, idx_t memory_delta, unique_ptr< FileBuffer > *buffer, ARGS...) |
| Helper. | |
| shared_ptr< BlockHandle > | RegisterMemory (MemoryTag tag, idx_t block_size, idx_t block_header_size, bool can_destroy) |
| idx_t | GetBlockAllocSize (idx_t block_size) const |
| Get allocated size for a block. | |
| void | PurgeQueue (const BlockHandle &handle) final |
| Garbage collect eviction queue. | |
| BufferPool & | GetBufferPool () const final |
| Get the buffer pool. | |
| TemporaryMemoryManager & | GetTemporaryMemoryManager () final |
| Get the manager assigning reservations for temporary memory, e.g., for query intermediates. | |
| void | WriteTemporaryBuffer (MemoryTag tag, block_id_t block_id, FileBuffer &buffer) final |
| Write a temporary buffer to disk. | |
| unique_ptr< FileBuffer > | ReadTemporaryBuffer (QueryContext context, MemoryTag tag, BlockHandle &block, unique_ptr< FileBuffer > buffer=nullptr) final |
| Read a temporary buffer from disk. | |
| string | GetTemporaryPath (block_id_t id) |
| Get the path of the temporary buffer. | |
| void | DeleteTemporaryFile (BlockMemory &memory) final |
| Delete the temporary file containing the block memory. | |
| void | RequireTemporaryDirectory () |
| void | AddToEvictionQueue (shared_ptr< BlockHandle > &handle) final |
| Add the block handle to the eviction queue. | |
| const char * | InMemoryWarning () |
| void | VerifyZeroReaders (BlockLock &l, shared_ptr< BlockHandle > &handle) |
| void | BatchRead (vector< shared_ptr< BlockHandle > > &handles, const map< block_id_t, idx_t > &load_map, block_id_t first_block, block_id_t last_block) |
| bool | EncryptTemporaryFiles () |
Static Protected Member Functions | |
| static data_ptr_t | BufferAllocatorAllocate (PrivateAllocatorData *private_data, idx_t size) |
| static void | BufferAllocatorFree (PrivateAllocatorData *private_data, data_ptr_t pointer, idx_t size) |
| static data_ptr_t | BufferAllocatorRealloc (PrivateAllocatorData *private_data, data_ptr_t pointer, idx_t old_size, idx_t size) |
Protected Attributes | |
| DatabaseInstance & | db |
| The database instance. | |
| BufferPool & | buffer_pool |
| The buffer pool. | |
| TemporaryFileData | temporary_directory |
| The variables related to temporary file management. | |
| atomic< block_id_t > | temporary_id |
| The temporary id used for managed buffers. | |
| Allocator | buffer_allocator |
| Allocator associated with the buffer manager, that passes all allocations through this buffer manager. | |
| unique_ptr< BlockManager > | temp_block_manager |
| Block manager for temp data. | |
| atomic< idx_t > | evicted_data_per_tag [MEMORY_TAG_COUNT] |
| Temporary evicted memory data per tag. | |
Friends | |
| class | BufferHandle |
| class | BlockHandle |
| class | BlockManager |
The BufferManager is in charge of handling memory management for a single database. It cooperatively shares a BufferPool with other BufferManagers, belonging to different databases. It hands out memory buffers that can be used by the database internally, and offers configuration options specific to a database, which need not be shared by the BufferPool, including whether to support swapping temp buffers to disk, and where to swap them to.
| duckdb::StandardBufferManager::StandardBufferManager | ( | DatabaseInstance & | db, |
| string | temp_directory ) |
|
override |
|
finalvirtual |
Registers a transient memory buffer.
Reimplemented from duckdb::BufferManager.

|
finalvirtual |
Registers an in-memory buffer that cannot be unloaded until it is destroyed. This buffer can be small (smaller than the block size of the temporary block manager). Unpin and Pin are NOPs on this block of memory.
Reimplemented from duckdb::BufferManager.


|
finalvirtual |
Returns the currently allocated memory.
Implements duckdb::BufferManager.

|
finalvirtual |
Returns the maximum available memory.
Implements duckdb::BufferManager.

|
finalvirtual |
Returns the currently used swap space.
Implements duckdb::BufferManager.
|
finalvirtual |
Returns the maximum swap space that can be used.
Implements duckdb::BufferManager.
|
finalvirtual |
Returns the block allocation size for buffer-managed blocks.
Implements duckdb::BufferManager.

|
finalvirtual |
Returns the block size for buffer-managed blocks.
Implements duckdb::BufferManager.

|
finalvirtual |
Returns the maximum available memory for a given query.
Implements duckdb::BufferManager.

|
finalvirtual |
Allocate an in-memory buffer with a single pin. The allocated memory is released when the buffer handle is destroyed.
Implements duckdb::BufferManager.


|
finalvirtual |
Allocate block-based memory. The block manager provides the block size, and the block header size. Returns the BlockHandle managing the registered memory.
Implements duckdb::BufferManager.


|
finalvirtual |
Allocate (temporary) memory of size block_size, and pin it.
Implements duckdb::BufferManager.


|
finalvirtual |
Allocate block-based memory and pin it.
Implements duckdb::BufferManager.

|
finalvirtual |
Pin a block handle.
Implements duckdb::BufferManager.


|
finalvirtual |
Implements duckdb::BufferManager.
|
finalvirtual |
Pre-fetch a series of blocks. Using this function is a performance suggestion.
Implements duckdb::BufferManager.
|
finalvirtual |
Unpin a block handle.
Implements duckdb::BufferManager.

Set a new memory limit to the buffer manager, throws an exception if the new limit is too low and not enough blocks can be evicted
Reimplemented from duckdb::BufferManager.
|
finalvirtual |
Set a new swap limit.
Reimplemented from duckdb::BufferManager.
|
overridevirtual |
Returns information about memory usage.
Implements duckdb::BufferManager.
|
finalvirtual |
Get the block manager used for in-memory data.
Implements duckdb::BufferManager.


|
finalvirtual |
Returns a list of all temporary files.
Reimplemented from duckdb::BufferManager.


|
inlinefinalvirtual |
Get the path to the temporary file directory.
Reimplemented from duckdb::BufferManager.
|
finalvirtual |
Set the path to the temporary file directory.
Reimplemented from duckdb::BufferManager.
|
finalvirtual |
Get the buffer allocator.
Reimplemented from duckdb::BufferManager.


|
inlineoverridevirtual |
Get the const database.
Implements duckdb::BufferManager.


|
inlineoverridevirtual |
|
overridevirtual |
Construct a managed buffer.
Reimplemented from duckdb::BufferManager.

|
finalvirtual |
Reserve memory.
Reimplemented from duckdb::BufferManager.


|
finalvirtual |
Free reserved memory.
Reimplemented from duckdb::BufferManager.


|
finalvirtual |
Returns true, if the path to the temporary file directory is not empty.
Reimplemented from duckdb::BufferManager.
|
finalvirtual |
Returns true if there are files found in the temporary directory.
Reimplemented from duckdb::BufferManager.

|
protected |
Helper.


|
protected |
Register an in-memory buffer of arbitrary size, as long as it is >= BLOCK_SIZE. can_destroy signifies whether or not the buffer can be destroyed instead of evicted, if true, it will be destroyed, if false, it will be written to a temporary file so it can be reloaded If we want to change this, e.g., to immediately destroy the buffer upon unpinning, we can call BlockHandle::SetDestroyBufferUpon The resulting buffer will already be allocated, but needs to be pinned in order to be used. This needs to be private to prevent creating blocks without ever pinning them: blocks that are never pinned are never added to the eviction queue


|
finalprotectedvirtual |
Garbage collect eviction queue.
Implements duckdb::BufferManager.

|
finalprotectedvirtual |
Get the buffer pool.
Reimplemented from duckdb::BufferManager.

|
finalprotectedvirtual |
Get the manager assigning reservations for temporary memory, e.g., for query intermediates.
Reimplemented from duckdb::BufferManager.

|
finalprotectedvirtual |
Write a temporary buffer to disk.
for very large buffers, we store the size of the buffer in plaintext.
Write the nonce (and tag for GCM).
Reimplemented from duckdb::BufferManager.


|
finalprotectedvirtual |
Read a temporary buffer from disk.
Read nonce and tag from file.
Read and decrypt the buffer.
Reimplemented from duckdb::BufferManager.


|
protected |
Get the path of the temporary buffer.


|
finalprotectedvirtual |
Delete the temporary file containing the block memory.
Reimplemented from duckdb::BufferManager.


|
protected |
|
finalprotectedvirtual |
Add the block handle to the eviction queue.
Reimplemented from duckdb::BufferManager.

|
protected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
protected |
When the BlockHandle reaches 0 readers, this creates a new FileBuffer for this BlockHandle and overwrites the data within with garbage. Any readers that do not hold the pin will notice

|
protected |
|
protected |