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

Public Member Functions

DUCKDB_API AllocatedData (Allocator &allocator, data_ptr_t pointer, idx_t allocated_size)
 
 AllocatedData (const AllocatedData &other)=delete
 
AllocatedDataoperator= (const AllocatedData &)=delete
 
DUCKDB_API AllocatedData (AllocatedData &&other) noexcept
 enable move constructors
 
DUCKDB_API AllocatedDataoperator= (AllocatedData &&) noexcept
 
data_ptr_t get ()
 
 operator bool () const
 
const_data_ptr_t get () const
 
idx_t GetSize () const
 
bool IsSet ()
 
optional_ptr< AllocatorGetAllocator () const
 
void Reset ()
 

Private Attributes

optional_ptr< Allocatorallocator
 
data_ptr_t pointer
 
idx_t allocated_size
 

Constructor & Destructor Documentation

◆ AllocatedData() [1/3]

duckdb::AllocatedData::AllocatedData ( )
32314 : allocator(nullptr), pointer(nullptr), allocated_size(0) {
32315}

◆ AllocatedData() [2/3]

duckdb::AllocatedData::AllocatedData ( Allocator allocator,
data_ptr_t  pointer,
idx_t  allocated_size 
)
32318 : allocator(&allocator), pointer(pointer), allocated_size(allocated_size) {
32319 if (!pointer) {
32320 throw InternalException("AllocatedData object constructed with nullptr");
32321 }
32322}

◆ ~AllocatedData()

duckdb::AllocatedData::~AllocatedData ( )
32323 {
32324 Reset();
32325}

◆ AllocatedData() [3/3]

duckdb::AllocatedData::AllocatedData ( AllocatedData &&  other)
noexcept

enable move constructors

32328 : allocator(other.allocator), pointer(nullptr), allocated_size(0) {
32329 std::swap(pointer, other.pointer);
32330 std::swap(allocated_size, other.allocated_size);
32331}

Member Function Documentation

◆ operator=()

AllocatedData & duckdb::AllocatedData::operator= ( AllocatedData &&  other)
noexcept
32333 {
32334 std::swap(allocator, other.allocator);
32335 std::swap(pointer, other.pointer);
32336 std::swap(allocated_size, other.allocated_size);
32337 return *this;
32338}

◆ get() [1/2]

data_ptr_t duckdb::AllocatedData::get ( )
inline
8616 { // NOLINT: matching std style
8617 return pointer;
8618 }

◆ operator bool()

duckdb::AllocatedData::operator bool ( ) const
inline
8619 { // NOLINT: missing explicit
8620 return pointer != nullptr;
8621 }

◆ get() [2/2]

const_data_ptr_t duckdb::AllocatedData::get ( ) const
inline
8622 { // NOLINT: matching std style
8623 return pointer;
8624 }

◆ GetSize()

idx_t duckdb::AllocatedData::GetSize ( ) const
inline
8625 {
8626 return allocated_size;
8627 }

◆ IsSet()

bool duckdb::AllocatedData::IsSet ( )
inline
8628 {
8629 return pointer;
8630 }

◆ GetAllocator()

optional_ptr< Allocator > duckdb::AllocatedData::GetAllocator ( ) const
inline
8631 {
8632 return allocator;
8633 }

◆ Reset()

void duckdb::AllocatedData::Reset ( )
32340 {
32341 if (!pointer) {
32342 return;
32343 }
32344 D_ASSERT(allocator);
32345 allocator->FreeData(pointer, allocated_size);
32346 allocated_size = 0;
32347 pointer = nullptr;
32348}

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