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

Public Member Functions

 BoundParameterMap (case_insensitive_map_t< BoundParameterData > &parameter_data)
LogicalType GetReturnType (const string &identifier)
bound_parameter_map_t * GetParametersPtr ()
const bound_parameter_map_t & GetParameters ()
const case_insensitive_map_t< BoundParameterData > & GetParameterData ()
unique_ptr< BoundParameterExpression > BindParameterExpression (ParameterExpression &expr)

Public Attributes

bool rebind = false
 Flag to indicate that we need to rebind this prepared statement before execution.

Private Member Functions

shared_ptr< BoundParameterData > CreateOrGetData (const string &identifier)
void CreateNewParameter (const string &id, const shared_ptr< BoundParameterData > &param_data)

Private Attributes

bound_parameter_map_t parameters
case_insensitive_map_t< BoundParameterData > & parameter_data

Constructor & Destructor Documentation

◆ BoundParameterMap()

duckdb::BoundParameterMap::BoundParameterMap ( case_insensitive_map_t< BoundParameterData > & parameter_data)
explicit
374909 : parameter_data(parameter_data) {
374910}

Member Function Documentation

◆ GetReturnType()

LogicalType duckdb::BoundParameterMap::GetReturnType ( const string & identifier)
374912 {
374913 D_ASSERT(!identifier.empty());
374914 auto it = parameter_data.find(identifier);
374915 if (it == parameter_data.end()) {
374916 return LogicalTypeId::UNKNOWN;
374917 }
374918 return it->second.return_type;
374919}

◆ GetParametersPtr()

bound_parameter_map_t * duckdb::BoundParameterMap::GetParametersPtr ( )
374921 {
374922 return &parameters;
374923}

◆ GetParameters()

const bound_parameter_map_t & duckdb::BoundParameterMap::GetParameters ( )
374925 {
374926 return parameters;
374927}

◆ GetParameterData()

const case_insensitive_map_t< BoundParameterData > & duckdb::BoundParameterMap::GetParameterData ( )
374929 {
374930 return parameter_data;
374931}

◆ BindParameterExpression()

unique_ptr< BoundParameterExpression > duckdb::BoundParameterMap::BindParameterExpression ( ParameterExpression & expr)
374946 {
374947 auto &identifier = expr.identifier;
374948 D_ASSERT(!parameter_data.count(identifier));
374949
374950 // No value has been supplied yet,
374951 // We return a shared pointer to an object that will get populated with a Value later
374952 // When the BoundParameterExpression gets executed, this will be used to get the corresponding value
374953 auto param_data = CreateOrGetData(identifier);
374954 auto bound_expr = make_uniq<BoundParameterExpression>(identifier);
374955
374956 bound_expr->parameter_data = param_data;
374957 bound_expr->SetAlias(expr.GetAlias());
374958
374959 auto param_type = param_data->return_type;
374960 auto identifier_type = GetReturnType(identifier);
374961
374962 // we found a type for this bound parameter, but now we found another occurrence with the same identifier,
374963 // a CAST around this consecutive occurrence might swallow the unknown type of this consecutive occurrence,
374964 // then, if we do not rebind, we potentially have unknown data types during execution
374965 if (identifier_type == LogicalType::UNKNOWN && param_type != LogicalType::UNKNOWN) {
374966 rebind = true;
374967 }
374968
374969 bound_expr->return_type = identifier_type;
374970 return bound_expr;
374971}
bool rebind
Flag to indicate that we need to rebind this prepared statement before execution.
Definition duckdb.hpp:44233

◆ CreateOrGetData()

shared_ptr< BoundParameterData > duckdb::BoundParameterMap::CreateOrGetData ( const string & identifier)
private
374933 {
374934 auto entry = parameters.find(identifier);
374935 if (entry == parameters.end()) {
374936 // no entry yet: create a new one
374937 auto data = make_shared_ptr<BoundParameterData>();
374938 data->return_type = GetReturnType(identifier);
374939
374940 CreateNewParameter(identifier, data);
374941 return data;
374942 }
374943 return entry->second;
374944}

◆ CreateNewParameter()

void duckdb::BoundParameterMap::CreateNewParameter ( const string & id,
const shared_ptr< BoundParameterData > & param_data )
private
374973 {
374974 D_ASSERT(!parameters.count(id));
374975 parameters.emplace(std::make_pair(id, param_data));
374976}

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