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::Function Class Reference

Function is the base class used for any type of function (scalar, aggregate or simple function). More...

#include <duckdb.hpp>

Inheritance diagram for duckdb::Function:

Public Member Functions

DUCKDB_API Function (string name)

Static Public Member Functions

static DUCKDB_API string CallToString (const string &catalog_name, const string &schema_name, const string &name, const vector< LogicalType > &arguments, const LogicalType &varargs=LogicalType::INVALID)
 Returns the formatted string name(arg1, arg2, ...).
static DUCKDB_API string CallToString (const string &catalog_name, const string &schema_name, const string &name, const vector< LogicalType > &arguments, const LogicalType &varargs, const LogicalType &return_type)
 Returns the formatted string name(arg1, arg2..) -> return_type.
static DUCKDB_API string CallToString (const string &catalog_name, const string &schema_name, const string &name, const vector< LogicalType > &arguments, const named_parameter_type_map_t &named_parameters)
 Returns the formatted string name(arg1, arg2.., np1=a, np2=b, ...).
static DUCKDB_API void EraseArgument (SimpleFunction &bound_function, vector< unique_ptr< Expression > > &arguments, idx_t argument_index)
 Used in the bind to erase an argument from a function.

Public Attributes

string name
 The name of the function.
string extra_info
 Additional Information to specify function from it's name.
string catalog_name
string schema_name

Detailed Description

Function is the base class used for any type of function (scalar, aggregate or simple function).

Constructor & Destructor Documentation

◆ Function()

duckdb::Function::Function ( string name)
explicit
220815 : name(std::move(name_p)) {
220816}
string name
The name of the function.
Definition duckdb.hpp:13881

◆ ~Function()

duckdb::Function::~Function ( )
virtual
220817 {
220818}

Member Function Documentation

◆ CallToString() [1/3]

string duckdb::Function::CallToString ( const string & catalog_name,
const string & schema_name,
const string & name,
const vector< LogicalType > & arguments,
const LogicalType & varargs = LogicalType::INVALID )
static

Returns the formatted string name(arg1, arg2, ...).

220900 {
220901 string result;
220902 if (RequiresCatalogAndSchemaNamePrefix(catalog_name, schema_name)) {
220903 result += catalog_name + "." + schema_name + ".";
220904 }
220905 result += name + "(";
220906 vector<string> string_arguments;
220907 for (auto &arg : arguments) {
220908 string_arguments.push_back(arg.ToString());
220909 }
220910 if (varargs.IsValid()) {
220911 string_arguments.push_back("[" + varargs.ToString() + "...]");
220912 }
220913 result += StringUtil::Join(string_arguments, ", ");
220914 return result + ")";
220915}
static DUCKDB_API string Join(const vector< string > &input, const string &separator)
Join multiple strings into one string. Components are concatenated by the given separator.
Definition duckdb.cpp:109497
internal::named_arg< T, Char > arg(const S &name, const T &arg)
Definition duckdb.cpp:16242
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CallToString() [2/3]

string duckdb::Function::CallToString ( const string & catalog_name,
const string & schema_name,
const string & name,
const vector< LogicalType > & arguments,
const LogicalType & varargs,
const LogicalType & return_type )
static

Returns the formatted string name(arg1, arg2..) -> return_type.

220919 {
220920 string result = CallToString(catalog_name, schema_name, name, arguments, varargs);
220921 result += " -> " + return_type.ToString();
220922 return result;
220923}
static DUCKDB_API string CallToString(const string &catalog_name, const string &schema_name, const string &name, const vector< LogicalType > &arguments, const LogicalType &varargs=LogicalType::INVALID)
Returns the formatted string name(arg1, arg2, ...).
Definition duckdb.cpp:220899
Here is the call graph for this function:

◆ CallToString() [3/3]

string duckdb::Function::CallToString ( const string & catalog_name,
const string & schema_name,
const string & name,
const vector< LogicalType > & arguments,
const named_parameter_type_map_t & named_parameters )
static

Returns the formatted string name(arg1, arg2.., np1=a, np2=b, ...).

220927 {
220928 vector<string> input_arguments;
220929 input_arguments.reserve(arguments.size() + named_parameters.size());
220930 for (auto &arg : arguments) {
220931 input_arguments.push_back(arg.ToString());
220932 }
220933 for (auto &kv : named_parameters) {
220934 input_arguments.push_back(StringUtil::Format("%s : %s", kv.first, kv.second.ToString()));
220935 }
220936 string prefix = "";
220937 if (RequiresCatalogAndSchemaNamePrefix(catalog_name, schema_name)) {
220938 prefix = StringUtil::Format("%s.%s.", catalog_name, schema_name);
220939 }
220940 return StringUtil::Format("%s%s(%s)", prefix, name, StringUtil::Join(input_arguments, ", "));
220941}
static string Format(const string fmt_str, ARGS... params)
Format a string using printf semantics.
Definition duckdb.hpp:4002
Here is the call graph for this function:

◆ EraseArgument()

void duckdb::Function::EraseArgument ( SimpleFunction & bound_function,
vector< unique_ptr< Expression > > & arguments,
idx_t argument_index )
static

Used in the bind to erase an argument from a function.

220944 {
220945 if (bound_function.original_arguments.empty()) {
220946 bound_function.original_arguments = bound_function.arguments;
220947 }
220948 D_ASSERT(arguments.size() == bound_function.arguments.size());
220949 D_ASSERT(argument_index < arguments.size());
220950 arguments.erase_at(argument_index);
220951 bound_function.arguments.erase_at(argument_index);
220952}

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