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

A BoundReferenceExpression represents a physical index into a DataChunk. More...

Inheritance diagram for duckdb::BoundReferenceExpression:
Collaboration diagram for duckdb::BoundReferenceExpression:

Public Member Functions

 BoundReferenceExpression (string alias, LogicalType type, idx_t index)
 BoundReferenceExpression (LogicalType type, storage_t index)
bool IsScalar () const override
 Returns true if expression does not contain a group ref or col ref or parameter.
bool IsFoldable () const override
string ToString () const override
 Convert the Expression to a String.
hash_t Hash () const override
bool Equals (const BaseExpression &other) const override
 Returns true if this expression is equal to another expression.
unique_ptr< Expression > Copy () const override
 Create a copy of this expression.
void Serialize (Serializer &serializer) const override
Public Member Functions inherited from duckdb::Expression
 Expression (ExpressionType type, ExpressionClass expression_class, LogicalType return_type)
bool IsAggregate () const override
 Returns true if this expression is an aggregate or not.
bool IsWindow () const override
 Returns true if the expression has a window function or not.
bool HasSubquery () const override
 Returns true if the query contains a subquery.
bool IsScalar () const override
 Returns true if expression does not contain a group ref or col ref or parameter.
bool HasParameter () const override
 Returns true if the expression has a parameter.
virtual bool IsVolatile () const
virtual bool IsConsistent () const
virtual bool PropagatesNullValues () const
virtual bool CanThrow () const
hash_t Hash () const override
bool Equals (const BaseExpression &other) const override
 Returns true if this expression is equal to another expression.
Public Member Functions inherited from duckdb::BaseExpression
 BaseExpression (ExpressionType type, ExpressionClass expression_class)
 Create an Expression.
ExpressionClass GetExpressionClass () const
 Returns the class of the expression.
ExpressionType GetExpressionType () const
 Returns the type of the expression.
void SetExpressionTypeUnsafe (ExpressionType new_type)
optional_idx GetQueryLocation () const
 Returns the location in the query (if any).
void SetQueryLocation (optional_idx location)
 Sets the location in the query.
bool HasAlias () const
 Returns true if the expression has a non-empty alias.
const string & GetAlias () const
 Returns the alias of the expression.
void SetAlias (const string &alias_p)
 Sets the alias of the expression.
void SetAlias (string &&alias_p)
 Sets the alias of the expression.
void ClearAlias ()
 Clears the alias of the expression.
virtual string GetName () const
 Get the name of the expression.
void Print () const
 Print the expression to stdout.
bool operator== (const BaseExpression &rhs) const
virtual void Verify () const
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Static Public Member Functions

static unique_ptr< Expression > Deserialize (Deserializer &deserializer)
Static Public Member Functions inherited from duckdb::Expression
static bool Equals (const Expression &left, const Expression &right)
static bool Equals (const unique_ptr< Expression > &left, const unique_ptr< Expression > &right)
static bool ListEquals (const vector< unique_ptr< Expression > > &left, const vector< unique_ptr< Expression > > &right)
static unique_ptr< Expression > Deserialize (Deserializer &deserializer)
Static Public Member Functions inherited from duckdb::BaseExpression
static bool Equals (const BaseExpression &left, const BaseExpression &right)

Public Attributes

storage_t index
 Index used to access data in the chunks.
Public Attributes inherited from duckdb::Expression
LogicalType return_type
 The return type of the expression.
unique_ptr< BaseStatistics > verification_stats
 Expression statistics (if any) - ONLY USED FOR VERIFICATION.
Public Attributes inherited from duckdb::BaseExpression
ExpressionType type
 Type of the expression.
ExpressionClass expression_class
 The expression class of the node.
string alias
 The alias of the expression,.
optional_idx query_location
 The location in the query (if any).

Static Public Attributes

static constexpr const ExpressionClass TYPE = ExpressionClass::BOUND_REF

Additional Inherited Members

Protected Member Functions inherited from duckdb::Expression
void CopyProperties (const Expression &other)

Detailed Description

A BoundReferenceExpression represents a physical index into a DataChunk.

Constructor & Destructor Documentation

◆ BoundReferenceExpression() [1/2]

duckdb::BoundReferenceExpression::BoundReferenceExpression ( string alias,
LogicalType type,
idx_t index )
376747 : Expression(ExpressionType::BOUND_REF, ExpressionClass::BOUND_REF, std::move(type)), index(index) {
376748 this->alias = std::move(alias);
376749}
string alias
The alias of the expression,.
Definition duckdb.hpp:13293
ExpressionType type
Type of the expression.
Definition duckdb.hpp:13287
storage_t index
Index used to access data in the chunks.
Definition duckdb.cpp:12645

◆ BoundReferenceExpression() [2/2]

duckdb::BoundReferenceExpression::BoundReferenceExpression ( LogicalType type,
storage_t index )
376751 : BoundReferenceExpression(string(), std::move(type), index) {
376752}

Member Function Documentation

◆ IsScalar()

bool duckdb::BoundReferenceExpression::IsScalar ( ) const
inlineoverridevirtual

Returns true if expression does not contain a group ref or col ref or parameter.

Implements duckdb::BaseExpression.

12648 {
12649 return false;
12650 }

◆ IsFoldable()

bool duckdb::BoundReferenceExpression::IsFoldable ( ) const
inlineoverridevirtual

Reimplemented from duckdb::Expression.

12651 {
12652 return false;
12653 }

◆ ToString()

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

Convert the Expression to a String.

Implements duckdb::BaseExpression.

376754 {
376755#ifdef DEBUG
376757 return StringUtil::Format("#%llu (%s)", index, return_type.ToString());
376758 }
376759#endif
376760 if (!alias.empty()) {
376761 return alias;
376762 }
376763 return "#" + to_string(index);
376764}
LogicalType return_type
The return type of the expression.
Definition duckdb.hpp:17743
static string Format(const string fmt_str, ARGS... params)
Format a string using printf semantics.
Definition duckdb.hpp:4002
std::string to_string(const T &value)
Definition duckdb.cpp:19425
static bool debug_print_bindings
Whether to print bindings when printing the plan (debug mode only).
Definition duckdb.hpp:40040
Here is the call graph for this function:

◆ Hash()

hash_t duckdb::BoundReferenceExpression::Hash ( ) const
overridevirtual

Creates a hash value of this expression. It is important that if two expressions are identical (i.e. Expression::Equals() returns true), that their hash value is identical as well.

Implements duckdb::BaseExpression.

376774 {
376775 return CombineHash(Expression::Hash(), duckdb::Hash<idx_t>(index));
376776}
hash_t Hash() const override
Definition duckdb.cpp:377203
hash_t CombineHash(hash_t left, hash_t right)
Combine two hashes by XORing them.
Definition duckdb.hpp:4635
Here is the call graph for this function:

◆ Equals()

bool duckdb::BoundReferenceExpression::Equals ( const BaseExpression & other) const
overridevirtual

Returns true if this expression is equal to another expression.

Reimplemented from duckdb::BaseExpression.

376766 {
376767 if (!Expression::Equals(other_p)) {
376768 return false;
376769 }
376770 auto &other = other_p.Cast<BoundReferenceExpression>();
376771 return other.index == index;
376772}
bool Equals(const BaseExpression &other) const override
Returns true if this expression is equal to another expression.
Definition duckdb.hpp:17762
Here is the call graph for this function:

◆ Copy()

unique_ptr< Expression > duckdb::BoundReferenceExpression::Copy ( ) const
overridevirtual

Create a copy of this expression.

Implements duckdb::Expression.

376778 {
376779 return make_uniq<BoundReferenceExpression>(alias, return_type, index);
376780}

◆ Serialize()

void duckdb::BoundReferenceExpression::Serialize ( Serializer & serializer) const
overridevirtual

Reimplemented from duckdb::Expression.

416173 {
416174 Expression::Serialize(serializer);
416175 serializer.WriteProperty<LogicalType>(200, "return_type", return_type);
416176 serializer.WritePropertyWithDefault<idx_t>(201, "index", index);
416177}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

◆ Deserialize()

unique_ptr< Expression > duckdb::BoundReferenceExpression::Deserialize ( Deserializer & deserializer)
static
416179 {
416180 auto return_type = deserializer.ReadProperty<LogicalType>(200, "return_type");
416181 auto index = deserializer.ReadPropertyWithDefault<idx_t>(201, "index");
416182 auto result = duckdb::unique_ptr<BoundReferenceExpression>(new BoundReferenceExpression(std::move(return_type), index));
416183 return std::move(result);
416184}

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