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::ArrowBuffer Struct Reference

Public Member Functions

 ArrowBuffer (const ArrowBuffer &other)=delete
 
ArrowBufferoperator= (const ArrowBuffer &)=delete
 
 ArrowBuffer (ArrowBuffer &&other) noexcept
 enable move constructors
 
ArrowBufferoperator= (ArrowBuffer &&other) noexcept
 
void reserve (idx_t bytes)
 
void resize (idx_t bytes)
 
void resize (idx_t bytes, data_t value)
 
template<class T >
void push_back (T value)
 
idx_t size ()
 
data_ptr_t data ()
 
template<class T >
T * GetData ()
 

Static Public Attributes

static constexpr const idx_t MINIMUM_SHRINK_SIZE = 4096
 

Private Member Functions

void ReserveInternal (idx_t bytes)
 

Private Attributes

data_ptr_t dataptr = nullptr
 
idx_t count = 0
 
idx_t capacity = 0
 

Constructor & Destructor Documentation

◆ ArrowBuffer() [1/2]

duckdb::ArrowBuffer::ArrowBuffer ( )
inline
32649 : dataptr(nullptr), count(0), capacity(0) {
32650 }

◆ ~ArrowBuffer()

duckdb::ArrowBuffer::~ArrowBuffer ( )
inline
32651 {
32652 if (!dataptr) {
32653 return;
32654 }
32655 free(dataptr);
32656 dataptr = nullptr;
32657 count = 0;
32658 capacity = 0;
32659 }

◆ ArrowBuffer() [2/2]

duckdb::ArrowBuffer::ArrowBuffer ( ArrowBuffer &&  other)
inlinenoexcept

enable move constructors

32664 : count(0), capacity(0) {
32665 std::swap(dataptr, other.dataptr);
32666 std::swap(count, other.count);
32667 std::swap(capacity, other.capacity);
32668 }

Member Function Documentation

◆ operator=()

ArrowBuffer & duckdb::ArrowBuffer::operator= ( ArrowBuffer &&  other)
inlinenoexcept
32669 {
32670 std::swap(dataptr, other.dataptr);
32671 std::swap(count, other.count);
32672 std::swap(capacity, other.capacity);
32673 return *this;
32674 }

◆ reserve()

void duckdb::ArrowBuffer::reserve ( idx_t  bytes)
inline
32676 { // NOLINT
32677 auto new_capacity = NextPowerOfTwo(bytes);
32678 if (new_capacity <= capacity) {
32679 return;
32680 }
32681 ReserveInternal(new_capacity);
32682 }

◆ resize() [1/2]

void duckdb::ArrowBuffer::resize ( idx_t  bytes)
inline
32684 { // NOLINT
32685 reserve(bytes);
32686 count = bytes;
32687 }

◆ resize() [2/2]

void duckdb::ArrowBuffer::resize ( idx_t  bytes,
data_t  value 
)
inline
32689 { // NOLINT
32690 reserve(bytes);
32691 for (idx_t i = count; i < bytes; i++) {
32692 dataptr[i] = value;
32693 }
32694 count = bytes;
32695 }

◆ push_back()

template<class T >
void duckdb::ArrowBuffer::push_back ( value)
inline
32698 {
32699 reserve(sizeof(T) * (count + 1));
32700 reinterpret_cast<T *>(dataptr)[count] = value;
32701 count++;
32702 }

◆ size()

idx_t duckdb::ArrowBuffer::size ( )
inline
32704 { // NOLINT
32705 return count;
32706 }

◆ data()

data_ptr_t duckdb::ArrowBuffer::data ( )
inline
32708 { // NOLINT
32709 return dataptr;
32710 }

◆ GetData()

template<class T >
T * duckdb::ArrowBuffer::GetData ( )
inline
32713 {
32714 return reinterpret_cast<T *>(data());
32715 }

◆ ReserveInternal()

void duckdb::ArrowBuffer::ReserveInternal ( idx_t  bytes)
inlineprivate
32718 {
32719 data_ptr_t new_ptr;
32720 if (dataptr) {
32721 new_ptr = data_ptr_cast(realloc(dataptr, bytes));
32722 } else {
32723 new_ptr = data_ptr_cast(malloc(bytes));
32724 }
32725 if (!new_ptr) {
32726 throw OutOfMemoryException("ArrowBuffer: failed to allocate %llu bytes", bytes);
32727 }
32728 dataptr = new_ptr;
32729 capacity = bytes;
32730 }

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