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

Public Member Functions

 VectorStringBuffer (Allocator &allocator)
 VectorStringBuffer (VectorBufferType type)
string_t AddString (const char *data, idx_t len)
string_t AddString (string_t data)
string_t AddBlob (string_t data)
string_t EmptyString (idx_t len)
ArenaAllocator & GetStringAllocator ()
data_ptr_t AllocateShrinkableBuffer (idx_t alloc_len)
string_t FinalizeShrinkableBuffer (data_ptr_t buffer, idx_t alloc_len, idx_t str_len)
void AddHeapReference (buffer_ptr< VectorBuffer > heap)
Public Member Functions inherited from duckdb::VectorBuffer
 VectorBuffer (VectorBufferType type)
 VectorBuffer (idx_t data_size)
 VectorBuffer (AllocatedData &&data_p)
data_ptr_t GetData ()
void SetData (AllocatedData &&new_data)
VectorAuxiliaryData * GetAuxiliaryData ()
void SetAuxiliaryData (unique_ptr< VectorAuxiliaryData > aux_data_p)
void MoveAuxiliaryData (VectorBuffer &source_buffer)
virtual optional_ptr< Allocator > GetAllocator () const
VectorBufferType GetBufferType () const
VectorAuxiliaryDataType GetAuxiliaryDataType () const
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Private Attributes

StringHeap heap
 The string heap of this buffer.
vector< buffer_ptr< VectorBuffer > > references
 References to additional vector buffers referenced by this string buffer.

Additional Inherited Members

Static Public Member Functions inherited from duckdb::VectorBuffer
static buffer_ptr< VectorBuffer > CreateStandardVector (PhysicalType type, idx_t capacity=STANDARD_VECTOR_SIZE)
static buffer_ptr< VectorBuffer > CreateConstantVector (PhysicalType type)
static buffer_ptr< VectorBuffer > CreateConstantVector (const LogicalType &logical_type)
static buffer_ptr< VectorBuffer > CreateStandardVector (const LogicalType &logical_type, idx_t capacity=STANDARD_VECTOR_SIZE)
Protected Attributes inherited from duckdb::VectorBuffer
VectorBufferType buffer_type
unique_ptr< VectorAuxiliaryData > aux_data
AllocatedData data

Constructor & Destructor Documentation

◆ VectorStringBuffer() [1/3]

duckdb::VectorStringBuffer::VectorStringBuffer ( )
138723 : VectorBuffer(VectorBufferType::STRING_BUFFER) {
138724}

◆ VectorStringBuffer() [2/3]

duckdb::VectorStringBuffer::VectorStringBuffer ( Allocator & allocator)
explicit
138727 : VectorBuffer(VectorBufferType::STRING_BUFFER), heap(allocator) {
138728}
StringHeap heap
The string heap of this buffer.
Definition duckdb.hpp:10172

◆ VectorStringBuffer() [3/3]

duckdb::VectorStringBuffer::VectorStringBuffer ( VectorBufferType type)
explicit
138730 : VectorBuffer(type) {
138731}

Member Function Documentation

◆ AddString() [1/2]

string_t duckdb::VectorStringBuffer::AddString ( const char * data,
idx_t len )
inline
10131 {
10132 return heap.AddString(data, len);
10133 }

◆ AddString() [2/2]

string_t duckdb::VectorStringBuffer::AddString ( string_t data)
inline
10134 {
10135 return heap.AddString(data);
10136 }

◆ AddBlob()

string_t duckdb::VectorStringBuffer::AddBlob ( string_t data)
inline
10137 {
10138 return heap.AddBlob(data.GetData(), data.GetSize());
10139 }

◆ EmptyString()

string_t duckdb::VectorStringBuffer::EmptyString ( idx_t len)
inline
10140 {
10141 return heap.EmptyString(len);
10142 }

◆ GetStringAllocator()

ArenaAllocator & duckdb::VectorStringBuffer::GetStringAllocator ( )
inline
10144 {
10145 return heap.GetAllocator();
10146 }

◆ AllocateShrinkableBuffer()

data_ptr_t duckdb::VectorStringBuffer::AllocateShrinkableBuffer ( idx_t alloc_len)
inline

Allocate a buffer to store up to "len" bytes for a string This can be turned into a proper string by using FinalizeBuffer afterwards Note that alloc_len only has to be an upper bound, the final string may be smaller

10150 {
10151 auto &allocator = heap.GetAllocator();
10152 return allocator.Allocate(alloc_len);
10153 }

◆ FinalizeShrinkableBuffer()

string_t duckdb::VectorStringBuffer::FinalizeShrinkableBuffer ( data_ptr_t buffer,
idx_t alloc_len,
idx_t str_len )
inline

Finalize a buffer allocated with AllocateShrinkableBuffer into a string of size str_len str_len must be <= alloc_len

10156 {
10157 auto &allocator = heap.GetAllocator();
10158 D_ASSERT(str_len <= alloc_len);
10159 D_ASSERT(buffer == allocator.GetHead()->data.get() + allocator.GetHead()->current_position - alloc_len);
10160 bool is_not_inlined = str_len > string_t::INLINE_LENGTH;
10161 idx_t shrink_count = alloc_len - (str_len * is_not_inlined);
10162 allocator.ShrinkHead(shrink_count);
10163 return string_t(const_char_ptr_cast(buffer), UnsafeNumericCast<uint32_t>(str_len));
10164 }
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

◆ AddHeapReference()

void duckdb::VectorStringBuffer::AddHeapReference ( buffer_ptr< VectorBuffer > heap)
inline
10166 {
10167 references.push_back(std::move(heap));
10168 }
vector< buffer_ptr< VectorBuffer > > references
References to additional vector buffers referenced by this string buffer.
Definition duckdb.hpp:10174

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