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

Represents a conjunction (AND/OR). More...

Inheritance diagram for duckdb::ConjunctionExpression:
Collaboration diagram for duckdb::ConjunctionExpression:

Public Member Functions

DUCKDB_API ConjunctionExpression (ExpressionType type)
DUCKDB_API ConjunctionExpression (ExpressionType type, vector< unique_ptr< ParsedExpression > > children)
DUCKDB_API ConjunctionExpression (ExpressionType type, unique_ptr< ParsedExpression > left, unique_ptr< ParsedExpression > right)
void AddExpression (unique_ptr< ParsedExpression > expr)
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 ConjunctionExpression &a, const ConjunctionExpression &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

vector< unique_ptr< ParsedExpression > > children
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::CONJUNCTION

Additional Inherited Members

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

Detailed Description

Represents a conjunction (AND/OR).

Constructor & Destructor Documentation

◆ ConjunctionExpression() [1/3]

duckdb::ConjunctionExpression::ConjunctionExpression ( ExpressionType type)
explicit
336635 : ParsedExpression(type, ExpressionClass::CONJUNCTION) {
336636}
ExpressionType type
Type of the expression.
Definition duckdb.hpp:13287
ParsedExpression(ExpressionType type, ExpressionClass expression_class)
Create an Expression.
Definition duckdb.hpp:13557

◆ ConjunctionExpression() [2/3]

duckdb::ConjunctionExpression::ConjunctionExpression ( ExpressionType type,
vector< unique_ptr< ParsedExpression > > children )
336639 : ParsedExpression(type, ExpressionClass::CONJUNCTION) {
336640 for (auto &child : children) {
336641 AddExpression(std::move(child));
336642 }
336643}

◆ ConjunctionExpression() [3/3]

duckdb::ConjunctionExpression::ConjunctionExpression ( ExpressionType type,
unique_ptr< ParsedExpression > left,
unique_ptr< ParsedExpression > right )
336647 : ParsedExpression(type, ExpressionClass::CONJUNCTION) {
336648 AddExpression(std::move(left));
336649 AddExpression(std::move(right));
336650}

Member Function Documentation

◆ AddExpression()

void duckdb::ConjunctionExpression::AddExpression ( unique_ptr< ParsedExpression > expr)
336652 {
336653 if (expr->GetExpressionType() == type) {
336654 // expr is a conjunction of the same type: merge the expression lists together
336655 auto &other = expr->Cast<ConjunctionExpression>();
336656 for (auto &child : other.children) {
336657 children.push_back(std::move(child));
336658 }
336659 } else {
336660 children.push_back(std::move(expr));
336661 }
336662}

◆ ToString() [1/2]

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

Convert the Expression to a String.

Implements duckdb::BaseExpression.

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

◆ Equal()

bool duckdb::ConjunctionExpression::Equal ( const ConjunctionExpression & a,
const ConjunctionExpression & b )
static
336668 {
336669 return ExpressionUtil::SetEquals(a.children, b.children);
336670}
static bool SetEquals(const vector< unique_ptr< ParsedExpression > > &a, const vector< unique_ptr< ParsedExpression > > &b)
SetEquals: check if two sets of expressions are equal (order is not important).
Definition duckdb.cpp:337979

◆ Copy()

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

Create a copy of this expression.

Implements duckdb::ParsedExpression.

336672 {
336673 vector<unique_ptr<ParsedExpression>> copy_children;
336674 copy_children.reserve(children.size());
336675 for (auto &expr : children) {
336676 copy_children.push_back(expr->Copy());
336677 }
336678
336679 auto copy = make_uniq<ConjunctionExpression>(type, std::move(copy_children));
336680 copy->CopyProperties(*this);
336681 return std::move(copy);
336682}

◆ Serialize()

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

Reimplemented from duckdb::ParsedExpression.

418805 {
418806 ParsedExpression::Serialize(serializer);
418807 serializer.WritePropertyWithDefault<vector<unique_ptr<ParsedExpression>>>(200, "children", children);
418808}

◆ Deserialize()

unique_ptr< ParsedExpression > duckdb::ConjunctionExpression::Deserialize ( Deserializer & deserializer)
static
418810 {
418811 auto result = duckdb::unique_ptr<ConjunctionExpression>(new ConjunctionExpression(deserializer.Get<ExpressionType>()));
418812 deserializer.ReadPropertyWithDefault<vector<unique_ptr<ParsedExpression>>>(200, "children", result->children);
418813 return std::move(result);
418814}

◆ ToString() [2/2]

template<class T, class BASE>
string duckdb::ConjunctionExpression::ToString ( const T & entry)
inlinestatic
297181 {
297182 string result = "(" + entry.children[0]->ToString();
297183 for (idx_t i = 1; i < entry.children.size(); i++) {
297184 result += " " + ExpressionTypeToOperator(entry.GetExpressionType()) + " " + entry.children[i]->ToString();
297185 }
297186 return result + ")";
297187 }
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

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