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

Public Member Functions

 DefaultTypeGenerator (Catalog &catalog, SchemaCatalogEntry &schema)
 
unique_ptr< CatalogEntryCreateDefaultEntry (ClientContext &context, const string &entry_name) override
 Creates a default entry with the specified name, or returns nullptr if no such entry can be generated.
 
vector< string > GetDefaultEntries () override
 Get a list of all default entries in the generator.
 
- Public Member Functions inherited from duckdb::DefaultGenerator
 DefaultGenerator (Catalog &catalog)
 
virtual unique_ptr< CatalogEntryCreateDefaultEntry (CatalogTransaction transaction, const string &entry_name)
 
virtual bool LockDuringCreate () const
 

Static Public Member Functions

static DUCKDB_API LogicalTypeId GetDefaultType (const string &name)
 
static DUCKDB_API LogicalType TryDefaultBind (const string &name, const vector< pair< string, Value > > &params)
 

Public Attributes

SchemaCatalogEntryschema
 
- Public Attributes inherited from duckdb::DefaultGenerator
Catalogcatalog
 
atomic< bool > created_all_entries
 

Constructor & Destructor Documentation

◆ DefaultTypeGenerator()

duckdb::DefaultTypeGenerator::DefaultTypeGenerator ( Catalog catalog,
SchemaCatalogEntry schema 
)
25138 : DefaultGenerator(catalog), schema(schema) {
25139}

Member Function Documentation

◆ GetDefaultType()

LogicalTypeId duckdb::DefaultTypeGenerator::GetDefaultType ( const string &  name)
static
25104 {
25105 auto &internal_types = BUILTIN_TYPES;
25106 for (auto &type : internal_types) {
25107 if (StringUtil::CIEquals(name, type.name)) {
25108 return type.type;
25109 }
25110 }
25111 return LogicalType::INVALID;
25112}
static DUCKDB_API bool CIEquals(const string &l1, const string &l2)
Case insensitive equals.

◆ TryDefaultBind()

LogicalType duckdb::DefaultTypeGenerator::TryDefaultBind ( const string &  name,
const vector< pair< string, Value > > &  params 
)
static
25114 {
25115 auto entry = TryGetDefaultTypeEntry(name);
25116 if (!entry) {
25117 return LogicalTypeId::INVALID;
25118 }
25119
25120 if (!entry->bind_function) {
25121 if (params.empty()) {
25122 return LogicalType(entry->type);
25123 } else {
25124 throw InvalidInputException("Type '%s' does not take any type parameters", name);
25125 }
25126 }
25127
25128 vector<TypeArgument> args;
25129 for (auto &param : params) {
25130 args.emplace_back(param.first, param.second);
25131 }
25132
25133 BindLogicalTypeInput input {nullptr, LogicalType(entry->type), args};
25134 return entry->bind_function(input);
25135}
PyParams params(const std::string &tag, const std::string &model, const std::string &weights, const std::string &device)

◆ CreateDefaultEntry()

unique_ptr< CatalogEntry > duckdb::DefaultTypeGenerator::CreateDefaultEntry ( ClientContext context,
const string &  entry_name 
)
overridevirtual

Creates a default entry with the specified name, or returns nullptr if no such entry can be generated.

Reimplemented from duckdb::DefaultGenerator.

25141 {
25142 if (schema.name != DEFAULT_SCHEMA) {
25143 return nullptr;
25144 }
25145 auto entry = TryGetDefaultTypeEntry(entry_name);
25146 if (!entry || entry->type == LogicalTypeId::INVALID) {
25147 return nullptr;
25148 }
25149 CreateTypeInfo info;
25150 info.name = entry_name;
25151 info.type = LogicalType(entry->type);
25152 info.internal = true;
25153 info.temporary = true;
25154 info.bind_function = entry->bind_function;
25155 return make_uniq_base<CatalogEntry, TypeCatalogEntry>(catalog, schema, info);
25156}
string name
The name of the entry.
Definition duckdb.hpp:6311

◆ GetDefaultEntries()

vector< string > duckdb::DefaultTypeGenerator::GetDefaultEntries ( )
overridevirtual

Get a list of all default entries in the generator.

Implements duckdb::DefaultGenerator.

25158 {
25159 vector<string> result;
25160 if (schema.name != DEFAULT_SCHEMA) {
25161 return result;
25162 }
25163 auto &internal_types = BUILTIN_TYPES;
25164 for (auto &type : internal_types) {
25165 result.emplace_back(StringUtil::Lower(type.name));
25166 }
25167 return result;
25168}
static DUCKDB_API string Lower(const string &str)
Convert a string to lowercase.
Here is the call graph for this function:

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