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

Public Member Functions

DUCKDB_API ComparisonExpression (ExpressionType type, unique_ptr< ParsedExpression > left, unique_ptr< ParsedExpression > right)
string ToString () const override
 Convert the Expression to a String.
unique_ptr< ParsedExpression > Copy () const override
 Create a copy of this expression.
void Serialize (Serializer &serializer) const override
Public Member Functions inherited from duckdb::ParsedExpression
 ParsedExpression (ExpressionType type, ExpressionClass expression_class)
 Create an Expression.
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.
bool Equals (const BaseExpression &other) const override
 Returns true if this expression is equal to another expression.
hash_t Hash () const override
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 bool Equal (const ComparisonExpression &a, const ComparisonExpression &b)
static unique_ptr< ParsedExpression > Deserialize (Deserializer &deserializer)
template<class T, class BASE>
static string ToString (const T &entry)
Static Public Member Functions inherited from duckdb::ParsedExpression
static unique_ptr< ParsedExpression > Deserialize (Deserializer &deserializer)
static bool Equals (const unique_ptr< ParsedExpression > &left, const unique_ptr< ParsedExpression > &right)
static bool ListEquals (const vector< unique_ptr< ParsedExpression > > &left, const vector< unique_ptr< ParsedExpression > > &right)
Static Public Member Functions inherited from duckdb::BaseExpression
static bool Equals (const BaseExpression &left, const BaseExpression &right)

Public Attributes

unique_ptr< ParsedExpression > left
unique_ptr< ParsedExpression > right
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::COMPARISON

Private Member Functions

 ComparisonExpression (ExpressionType type)

Additional Inherited Members

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

Detailed Description

ComparisonExpression represents a boolean comparison (e.g. =, >=, <>). Always returns a boolean and has two children.

Constructor & Destructor Documentation

◆ ComparisonExpression() [1/2]

duckdb::ComparisonExpression::ComparisonExpression ( ExpressionType type,
unique_ptr< ParsedExpression > left,
unique_ptr< ParsedExpression > right )
336569 : ParsedExpression(type, ExpressionClass::COMPARISON), left(std::move(left)), right(std::move(right)) {
336570}
ExpressionType type
Type of the expression.
Definition duckdb.hpp:13287
ParsedExpression(ExpressionType type, ExpressionClass expression_class)
Create an Expression.
Definition duckdb.hpp:13557

◆ ComparisonExpression() [2/2]

duckdb::ComparisonExpression::ComparisonExpression ( ExpressionType type)
explicitprivate
336564 : ParsedExpression(type, ExpressionClass::COMPARISON) {
336565}

Member Function Documentation

◆ ToString() [1/2]

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

Convert the Expression to a String.

Implements duckdb::BaseExpression.

336572 {
336574}
string ToString() const override
Convert the Expression to a String.
Definition duckdb.cpp:336572
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Equal()

bool duckdb::ComparisonExpression::Equal ( const ComparisonExpression & a,
const ComparisonExpression & b )
static
336576 {
336577 if (!a.left->Equals(*b.left)) {
336578 return false;
336579 }
336580 if (!a.right->Equals(*b.right)) {
336581 return false;
336582 }
336583 return true;
336584}

◆ Copy()

unique_ptr< ParsedExpression > duckdb::ComparisonExpression::Copy ( ) const
overridevirtual

Create a copy of this expression.

Implements duckdb::ParsedExpression.

336586 {
336587 auto copy = make_uniq<ComparisonExpression>(type, left->Copy(), right->Copy());
336588 copy->CopyProperties(*this);
336589 return std::move(copy);
336590}

◆ Serialize()

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

Reimplemented from duckdb::ParsedExpression.

418792 {
418793 ParsedExpression::Serialize(serializer);
418794 serializer.WritePropertyWithDefault<unique_ptr<ParsedExpression>>(200, "left", left);
418795 serializer.WritePropertyWithDefault<unique_ptr<ParsedExpression>>(201, "right", right);
418796}

◆ Deserialize()

unique_ptr< ParsedExpression > duckdb::ComparisonExpression::Deserialize ( Deserializer & deserializer)
static
418798 {
418799 auto result = duckdb::unique_ptr<ComparisonExpression>(new ComparisonExpression(deserializer.Get<ExpressionType>()));
418800 deserializer.ReadPropertyWithDefault<unique_ptr<ParsedExpression>>(200, "left", result->left);
418801 deserializer.ReadPropertyWithDefault<unique_ptr<ParsedExpression>>(201, "right", result->right);
418802 return std::move(result);
418803}

◆ ToString() [2/2]

template<class T, class BASE>
string duckdb::ComparisonExpression::ToString ( const T & entry)
inlinestatic
201957 {
201958 return StringUtil::Format("(%s %s %s)", entry.left->ToString(),
201959 ExpressionTypeToOperator(entry.GetExpressionType()), entry.right->ToString());
201960 }
static string Format(const string fmt_str, ARGS... params)
Format a string using printf semantics.
Definition duckdb.hpp:4002

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