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

Public Member Functions

DUCKDB_API BaseScalarFunction (string name, vector< LogicalType > arguments, LogicalType return_type, FunctionStability stability, LogicalType varargs=LogicalType(LogicalTypeId::INVALID), FunctionNullHandling null_handling=FunctionNullHandling::DEFAULT_NULL_HANDLING, FunctionErrors errors=FunctionErrors::CANNOT_ERROR)
void SetReturnType (LogicalType return_type_p)
const LogicalType & GetReturnType () const
LogicalType & GetReturnType ()
FunctionStability GetStability () const
void SetStability (FunctionStability stability_p)
FunctionNullHandling GetNullHandling () const
void SetNullHandling (FunctionNullHandling null_handling_p)
FunctionErrors GetErrorMode () const
void SetErrorMode (FunctionErrors errors_p)
void SetFallible ()
 Set this functions error-mode as fallible (can throw runtime errors).
void SetVolatile ()
 Set this functions stability as volatile (can not be cached per row).
void SetCollationHandling (FunctionCollationHandling collation_handling_p)
FunctionCollationHandling GetCollationHandling () const
DUCKDB_API hash_t Hash () const
DUCKDB_API string ToString () const override
Public Member Functions inherited from duckdb::SimpleFunction
DUCKDB_API SimpleFunction (string name, vector< LogicalType > arguments, LogicalType varargs=LogicalType(LogicalTypeId::INVALID))
DUCKDB_API bool HasVarArgs () const
Public Member Functions inherited from duckdb::Function
DUCKDB_API Function (string name)

Static Public Member Functions

static BaseScalarFunction SetReturnsError (BaseScalarFunction &function)
Static Public Member Functions inherited from duckdb::Function
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

LogicalType return_type
 Return type of the function.
FunctionStability stability
 The stability of the function (see FunctionStability enum for more info).
FunctionNullHandling null_handling
 How this function handles NULL values.
FunctionErrors errors
 Whether or not this function can throw an error.
FunctionCollationHandling collation_handling
 Collation handling of the function.
Public Attributes inherited from duckdb::SimpleFunction
vector< LogicalType > arguments
 The set of arguments of the function.
vector< LogicalType > original_arguments
LogicalType varargs
Public Attributes inherited from duckdb::Function
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

Constructor & Destructor Documentation

◆ BaseScalarFunction()

duckdb::BaseScalarFunction::BaseScalarFunction ( string name,
vector< LogicalType > arguments,
LogicalType return_type,
FunctionStability stability,
LogicalType varargs = LogicalType(LogicalTypeId::INVALID),
FunctionNullHandling null_handling = FunctionNullHandling::DEFAULT_NULL_HANDLING,
FunctionErrors errors = FunctionErrors::CANNOT_ERROR )
220854 : SimpleFunction(std::move(name_p), std::move(arguments_p), std::move(varargs_p)),
220855 return_type(std::move(return_type_p)), stability(stability), null_handling(null_handling), errors(errors),
220856 collation_handling(FunctionCollationHandling::PROPAGATE_COLLATIONS) {
220857}
FunctionNullHandling null_handling
How this function handles NULL values.
Definition duckdb.hpp:14008
FunctionStability stability
The stability of the function (see FunctionStability enum for more info).
Definition duckdb.hpp:14006
LogicalType return_type
Return type of the function.
Definition duckdb.hpp:14004
FunctionCollationHandling collation_handling
Collation handling of the function.
Definition duckdb.hpp:14012
FunctionErrors errors
Whether or not this function can throw an error.
Definition duckdb.hpp:14010

◆ ~BaseScalarFunction()

duckdb::BaseScalarFunction::~BaseScalarFunction ( )
override
220859 {
220860}

Member Function Documentation

◆ SetReturnType()

void duckdb::BaseScalarFunction::SetReturnType ( LogicalType return_type_p)
inline
13955 {
13956 return_type = std::move(return_type_p);
13957 }

◆ GetReturnType() [1/2]

const LogicalType & duckdb::BaseScalarFunction::GetReturnType ( ) const
inline
13958 {
13959 return return_type;
13960 }

◆ GetReturnType() [2/2]

LogicalType & duckdb::BaseScalarFunction::GetReturnType ( )
inline
13961 {
13962 return return_type;
13963 }

◆ GetStability()

FunctionStability duckdb::BaseScalarFunction::GetStability ( ) const
inline
13965 {
13966 return stability;
13967 }

◆ SetStability()

void duckdb::BaseScalarFunction::SetStability ( FunctionStability stability_p)
inline
13968 {
13969 stability = stability_p;
13970 }

◆ GetNullHandling()

FunctionNullHandling duckdb::BaseScalarFunction::GetNullHandling ( ) const
inline
13972 {
13973 return null_handling;
13974 }

◆ SetNullHandling()

void duckdb::BaseScalarFunction::SetNullHandling ( FunctionNullHandling null_handling_p)
inline
13975 {
13976 null_handling = null_handling_p;
13977 }

◆ GetErrorMode()

FunctionErrors duckdb::BaseScalarFunction::GetErrorMode ( ) const
inline
13979 {
13980 return errors;
13981 }

◆ SetErrorMode()

void duckdb::BaseScalarFunction::SetErrorMode ( FunctionErrors errors_p)
inline
13982 {
13983 errors = errors_p;
13984 }

◆ SetFallible()

void duckdb::BaseScalarFunction::SetFallible ( )
inline

Set this functions error-mode as fallible (can throw runtime errors).

13987 {
13988 errors = FunctionErrors::CAN_THROW_RUNTIME_ERROR;
13989 }

◆ SetVolatile()

void duckdb::BaseScalarFunction::SetVolatile ( )
inline

Set this functions stability as volatile (can not be cached per row).

13991 {
13992 stability = FunctionStability::VOLATILE;
13993 }

◆ SetCollationHandling()

void duckdb::BaseScalarFunction::SetCollationHandling ( FunctionCollationHandling collation_handling_p)
inline
13995 {
13996 collation_handling = collation_handling_p;
13997 }

◆ GetCollationHandling()

FunctionCollationHandling duckdb::BaseScalarFunction::GetCollationHandling ( ) const
inline
13998 {
13999 return collation_handling;
14000 }

◆ SetReturnsError()

BaseScalarFunction duckdb::BaseScalarFunction::SetReturnsError ( BaseScalarFunction & function)
inlinestatic
14014 {
14015 function.errors = FunctionErrors::CAN_THROW_RUNTIME_ERROR;
14016 return function;
14017 }

◆ Hash()

hash_t duckdb::BaseScalarFunction::Hash ( ) const
220886 {
220887 hash_t hash = return_type.Hash();
220888 for (auto &arg : arguments) {
220889 hash = duckdb::CombineHash(hash, arg.Hash());
220890 }
220891 return hash;
220892}
vector< LogicalType > arguments
The set of arguments of the function.
Definition duckdb.hpp:13917
internal::named_arg< T, Char > arg(const S &name, const T &arg)
Definition duckdb.cpp:16242
uint64_t hash_t
The type used for hashes.
Definition duckdb.hpp:243
hash_t CombineHash(hash_t left, hash_t right)
Combine two hashes by XORing them.
Definition duckdb.hpp:4635

◆ ToString()

string duckdb::BaseScalarFunction::ToString ( ) const
overridevirtual

Reimplemented from duckdb::SimpleFunction.

220862 {
220863 return Function::CallToString(catalog_name, schema_name, name, arguments, varargs, return_type);
220864}
string name
The name of the function.
Definition duckdb.hpp:13881
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
LogicalType varargs
Definition duckdb.hpp:13923

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