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)
 
ArenaAllocatorGetStringAllocator ()
 
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)
 
VectorAuxiliaryDataGetAuxiliaryData ()
 
void SetAuxiliaryData (unique_ptr< VectorAuxiliaryData > aux_data_p)
 
void MoveAuxiliaryData (VectorBuffer &source_buffer)
 
virtual optional_ptr< AllocatorGetAllocator () const
 
VectorBufferType GetBufferType () const
 
VectorAuxiliaryDataType GetAuxiliaryDataType () const
 
template<class TARGET >
TARGETCast ()
 
template<class TARGET >
const TARGETCast () 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< VectorBufferCreateStandardVector (PhysicalType type, idx_t capacity=STANDARD_VECTOR_SIZE)
 
static buffer_ptr< VectorBufferCreateConstantVector (PhysicalType type)
 
static buffer_ptr< VectorBufferCreateConstantVector (const LogicalType &logical_type)
 
static buffer_ptr< VectorBufferCreateStandardVector (const LogicalType &logical_type, idx_t capacity=STANDARD_VECTOR_SIZE)
 
- Protected Attributes inherited from duckdb::VectorBuffer
VectorBufferType buffer_type
 
unique_ptr< VectorAuxiliaryDataaux_data
 
AllocatedData data
 

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 }
DUCKDB_API string_t AddString(const char *data, idx_t len)
Add a string to the string heap, returns a pointer to the string.
StringHeap heap
The string heap of this buffer.
Definition duckdb.hpp:10172

◆ 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 }
DUCKDB_API string_t AddBlob(const string_t &data)
Add a blob to the string heap; blobs can be non-valid UTF8.

◆ EmptyString()

string_t duckdb::VectorStringBuffer::EmptyString ( idx_t  len)
inline
10140 {
10141 return heap.EmptyString(len);
10142 }
DUCKDB_API string_t EmptyString(idx_t len)
Allocates space for an empty string of size "len" on the heap.

◆ 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 }

◆ 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 file: