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

Static Public Member Functions

static DUCKDB_API string_t AddString (Vector &vector, const char *data, idx_t len)
 Add a string to the string heap of the vector (auxiliary data).
static DUCKDB_API string_t AddStringOrBlob (Vector &vector, const char *data, idx_t len)
static DUCKDB_API string_t AddString (Vector &vector, const char *data)
 Add a string to the string heap of the vector (auxiliary data).
static DUCKDB_API string_t AddString (Vector &vector, string_t data)
 Add a string to the string heap of the vector (auxiliary data).
static DUCKDB_API string_t AddString (Vector &vector, const string &data)
 Add a string to the string heap of the vector (auxiliary data).
static DUCKDB_API string_t AddStringOrBlob (Vector &vector, string_t data)
static DUCKDB_API string_t EmptyString (Vector &vector, idx_t len)
static DUCKDB_API VectorStringBuffer & GetStringBuffer (Vector &vector)
 Returns a reference to the underlying VectorStringBuffer - throws an error if vector is not of type VARCHAR.
static DUCKDB_API void AddHandle (Vector &vector, BufferHandle handle)
 Adds a reference to a handle that stores strings of this vector.
static DUCKDB_API void AddBuffer (Vector &vector, buffer_ptr< VectorBuffer > buffer)
 Adds a reference to an unspecified vector buffer that stores strings of this vector.
static DUCKDB_API void AddHeapReference (Vector &vector, Vector &other)
 Add a reference from this vector to the string heap of the provided vector.

Member Function Documentation

◆ AddString() [1/4]

string_t duckdb::StringVector::AddString ( Vector & vector,
const char * data,
idx_t len )
static

Add a string to the string heap of the vector (auxiliary data).

137889 {
137890 return StringVector::AddString(vector, string_t(data, UnsafeNumericCast<uint32_t>(len)));
137891}
static DUCKDB_API string_t AddString(Vector &vector, const char *data, idx_t len)
Add a string to the string heap of the vector (auxiliary data).
Definition duckdb.cpp:137889
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddStringOrBlob() [1/2]

string_t duckdb::StringVector::AddStringOrBlob ( Vector & vector,
const char * data,
idx_t len )
static

Add a string or a blob to the string heap of the vector (auxiliary data) This function is the same as ::AddString, except the added data does not need to be valid UTF8

137893 {
137894 return StringVector::AddStringOrBlob(vector, string_t(data, UnsafeNumericCast<uint32_t>(len)));
137895}
static DUCKDB_API string_t AddStringOrBlob(Vector &vector, const char *data, idx_t len)
Definition duckdb.cpp:137893
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddString() [2/4]

string_t duckdb::StringVector::AddString ( Vector & vector,
const char * data )
static

Add a string to the string heap of the vector (auxiliary data).

137897 {
137898 return StringVector::AddString(vector, string_t(data, UnsafeNumericCast<uint32_t>(strlen(data))));
137899}
Here is the call graph for this function:

◆ AddString() [3/4]

string_t duckdb::StringVector::AddString ( Vector & vector,
string_t data )
static

Add a string to the string heap of the vector (auxiliary data).

137922 {
137923 D_ASSERT(vector.GetType().id() == LogicalTypeId::VARCHAR || vector.GetType().id() == LogicalTypeId::BIT);
137924 if (data.IsInlined()) {
137925 // string will be inlined: no need to store in string heap
137926 return data;
137927 }
137928 auto &string_buffer = GetStringBuffer(vector);
137929 return string_buffer.AddString(data);
137930}
static DUCKDB_API VectorStringBuffer & GetStringBuffer(Vector &vector)
Returns a reference to the underlying VectorStringBuffer - throws an error if vector is not of type V...
Definition duckdb.cpp:137905
Here is the call graph for this function:

◆ AddString() [4/4]

string_t duckdb::StringVector::AddString ( Vector & vector,
const string & data )
static

Add a string to the string heap of the vector (auxiliary data).

137901 {
137902 return StringVector::AddString(vector, string_t(data.c_str(), UnsafeNumericCast<uint32_t>(data.size())));
137903}
Here is the call graph for this function:

◆ AddStringOrBlob() [2/2]

string_t duckdb::StringVector::AddStringOrBlob ( Vector & vector,
string_t data )
static

Add a string or a blob to the string heap of the vector (auxiliary data) This function is the same as ::AddString, except the added data does not need to be valid UTF8

137932 {
137933 D_ASSERT(vector.GetType().InternalType() == PhysicalType::VARCHAR);
137934 if (data.IsInlined()) {
137935 // string will be inlined: no need to store in string heap
137936 return data;
137937 }
137938 auto &string_buffer = GetStringBuffer(vector);
137939 return string_buffer.AddBlob(data);
137940}
@ VARCHAR
DuckDB Extensions.
Definition duckdb.hpp:2847
Here is the call graph for this function:

◆ EmptyString()

string_t duckdb::StringVector::EmptyString ( Vector & vector,
idx_t len )
static

Allocates an empty string of the specified size, and returns a writable pointer that can be used to store the result of an operation

137942 {
137943 D_ASSERT(vector.GetType().InternalType() == PhysicalType::VARCHAR);
137944 if (len <= string_t::INLINE_LENGTH) {
137945 return string_t(UnsafeNumericCast<uint32_t>(len));
137946 }
137947 auto &string_buffer = GetStringBuffer(vector);
137948 return string_buffer.EmptyString(len);
137949}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetStringBuffer()

VectorStringBuffer & duckdb::StringVector::GetStringBuffer ( Vector & vector)
static

Returns a reference to the underlying VectorStringBuffer - throws an error if vector is not of type VARCHAR.

137905 {
137906 if (vector.GetType().InternalType() != PhysicalType::VARCHAR) {
137907 throw InternalException("StringVector::GetStringBuffer - vector is not of internal type VARCHAR but of type %s",
137908 vector.GetType());
137909 }
137910 if (!vector.auxiliary) {
137911 auto stored_allocator = vector.buffer ? vector.buffer->GetAllocator() : nullptr;
137912 if (stored_allocator) {
137913 vector.auxiliary = make_buffer<VectorStringBuffer>(*stored_allocator);
137914 } else {
137915 vector.auxiliary = make_buffer<VectorStringBuffer>();
137916 }
137917 }
137918 D_ASSERT(vector.auxiliary->GetBufferType() == VectorBufferType::STRING_BUFFER);
137919 return vector.auxiliary.get()->Cast<VectorStringBuffer>();
137920}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddHandle()

void duckdb::StringVector::AddHandle ( Vector & vector,
BufferHandle handle )
static

Adds a reference to a handle that stores strings of this vector.

137951 {
137952 auto &string_buffer = GetStringBuffer(vector);
137953 string_buffer.AddHeapReference(make_buffer<ManagedVectorBuffer>(std::move(handle)));
137954}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddBuffer()

void duckdb::StringVector::AddBuffer ( Vector & vector,
buffer_ptr< VectorBuffer > buffer )
static

Adds a reference to an unspecified vector buffer that stores strings of this vector.

137956 {
137957 D_ASSERT(buffer.get() != vector.auxiliary.get());
137958 auto &string_buffer = GetStringBuffer(vector);
137959 string_buffer.AddHeapReference(std::move(buffer));
137960}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddHeapReference()

void duckdb::StringVector::AddHeapReference ( Vector & vector,
Vector & other )
static

Add a reference from this vector to the string heap of the provided vector.

137962 {
137963 D_ASSERT(vector.GetType().InternalType() == PhysicalType::VARCHAR);
137964 D_ASSERT(other.GetType().InternalType() == PhysicalType::VARCHAR);
137965
137966 if (other.GetVectorType() == VectorType::DICTIONARY_VECTOR) {
137967 StringVector::AddHeapReference(vector, DictionaryVector::Child(other));
137968 return;
137969 }
137970 if (!other.auxiliary) {
137971 return;
137972 }
137973 StringVector::AddBuffer(vector, other.auxiliary);
137974}
static DUCKDB_API void AddHeapReference(Vector &vector, Vector &other)
Add a reference from this vector to the string heap of the provided vector.
Definition duckdb.cpp:137962
static DUCKDB_API void AddBuffer(Vector &vector, buffer_ptr< VectorBuffer > buffer)
Adds a reference to an unspecified vector buffer that stores strings of this vector.
Definition duckdb.cpp:137956
Here is the call graph for this function:
Here is the caller graph for this function:

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