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::FlattenedCoalesce Struct Reference
Collaboration diagram for duckdb::FlattenedCoalesce:

Public Member Functions

bool operator== (const FlattenedCoalesce &other) const

Static Public Member Functions

static FlattenedCoalesce Of (const vector< reference< Expression > > &expressions)

Public Attributes

vector< reference< Expression > > args

Static Private Member Functions

static void EnumerateFlattenedCoalesceArgs (Expression &expr, const std::function< void(Expression &arg)> &callback)

Detailed Description

A representation of a coalesce expression that removes unnecessary usages of coalesce in its arguments when such usages don't affect the final value of the expression. E.g. coalesce(a, coalesce(b, c)) is equivalent to coalesce(a, b, c) so that similarly, with some abuse of notation, FlattenedCoalesce::Of({a, coalesce(b, c)}) == FlattenedCoalesce.Of({a, b, c})

Member Function Documentation

◆ operator==()

bool duckdb::FlattenedCoalesce::operator== ( const FlattenedCoalesce & other) const
inline
317505 {
317506 if (args.size() != other.args.size()) {
317507 return false;
317508 }
317509
317510 for (idx_t i = 0; i < args.size(); i++) {
317511 if (!args[i].get().Equals(other.args[i].get())) {
317512 return false;
317513 }
317514 }
317515
317516 return true;
317517 }
__host__ cudaTextureObject_t get() const noexcept
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

◆ Of()

FlattenedCoalesce duckdb::FlattenedCoalesce::Of ( const vector< reference< Expression > > & expressions)
inlinestatic
317519 {
317520 vector<reference<Expression>> args {};
317521 for (auto expr : expressions) {
317522 EnumerateFlattenedCoalesceArgs(expr, [&](Expression &arg) { args.push_back(arg); });
317523 }
317524 return {args};
317525 }
internal::named_arg< T, Char > arg(const S &name, const T &arg)
Definition duckdb.cpp:16242

◆ EnumerateFlattenedCoalesceArgs()

void duckdb::FlattenedCoalesce::EnumerateFlattenedCoalesceArgs ( Expression & expr,
const std::function< void(Expression &arg)> & callback )
inlinestaticprivate
317528 {
317529 if (expr.GetExpressionType() == ExpressionType::OPERATOR_COALESCE) {
317530 ExpressionIterator::EnumerateChildren(
317531 expr, [&](Expression &arg) { EnumerateFlattenedCoalesceArgs(arg, callback); });
317532 } else {
317533 callback(expr);
317534 }
317535 }

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