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

Static Public Member Functions

static DUCKDB_API int64_t GetPos (const LogicalType &type, const string_t &key)
static DUCKDB_API const Vector & GetValuesInsertOrder (const LogicalType &type)
static DUCKDB_API idx_t GetSize (const LogicalType &type)
static DUCKDB_API const string GetValue (const Value &val)
static DUCKDB_API PhysicalType GetPhysicalType (const LogicalType &type)
static DUCKDB_API string_t GetString (const LogicalType &type, idx_t pos)

Member Function Documentation

◆ GetPos()

int64_t duckdb::EnumType::GetPos ( const LogicalType & type,
const string_t & key )
static
72495 {
72496 auto info = type.AuxInfo();
72497 switch (type.InternalType()) {
72499 return TemplatedGetPos(info->Cast<EnumTypeInfoTemplated<uint8_t>>().GetValues(), key);
72501 return TemplatedGetPos(info->Cast<EnumTypeInfoTemplated<uint16_t>>().GetValues(), key);
72503 return TemplatedGetPos(info->Cast<EnumTypeInfoTemplated<uint32_t>>().GetValues(), key);
72504 default:
72505 throw InternalException("ENUM can only have unsigned integers (except UINT64) as physical types");
72506 }
72507}
@ UINT32
Unsigned 32-bit little-endian integer.
Definition duckdb.hpp:2758
@ UINT16
Unsigned 16-bit little-endian integer.
Definition duckdb.hpp:2752
@ UINT8
Unsigned 8-bit little-endian integer.
Definition duckdb.hpp:2746

◆ GetValuesInsertOrder()

const Vector & duckdb::EnumType::GetValuesInsertOrder ( const LogicalType & type)
static
140769 {
140770 D_ASSERT(type.id() == LogicalTypeId::ENUM);
140771 auto info = type.AuxInfo();
140772 return info->Cast<EnumTypeInfo>().GetValuesInsertOrder();
140773}

◆ GetSize()

idx_t duckdb::EnumType::GetSize ( const LogicalType & type)
static
140775 {
140776 D_ASSERT(type.id() == LogicalTypeId::ENUM);
140777 auto info = type.AuxInfo();
140778 return info->Cast<EnumTypeInfo>().GetDictSize();
140779}

◆ GetValue()

const string duckdb::EnumType::GetValue ( const Value & val)
static
140763 {
140764 auto info = val.type().AuxInfo();
140765 auto &values_insert_order = info->Cast<EnumTypeInfo>().GetValuesInsertOrder();
140766 return StringValue::Get(values_insert_order.GetValue(val.GetValue<uint32_t>()));
140767}

◆ GetPhysicalType()

PhysicalType duckdb::EnumType::GetPhysicalType ( const LogicalType & type)
static
140781 {
140782 D_ASSERT(type.id() == LogicalTypeId::ENUM);
140783 auto aux_info = type.AuxInfo();
140784 auto &info = aux_info->Cast<EnumTypeInfo>();
140785 D_ASSERT(info.GetEnumDictType() == EnumDictType::VECTOR_DICT);
140786 return EnumTypeInfo::DictType(info.GetDictSize());
140787}

◆ GetString()

string_t duckdb::EnumType::GetString ( const LogicalType & type,
idx_t pos )
static
72509 {
72510 D_ASSERT(pos < EnumType::GetSize(type));
72511 return FlatVector::GetData<string_t>(EnumType::GetValuesInsertOrder(type))[pos];
72512}

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