iceberg-cpp
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
iceberg::And Class Reference

An Expression that represents a logical AND operation between two expressions. More...

#include <expression.h>

Inheritance diagram for iceberg::And:
iceberg::Expression iceberg::util::Formattable

Public Member Functions

const std::shared_ptr< Expression > & left () const
 Returns the left operand of the AND expression.
 
const std::shared_ptr< Expression > & right () const
 Returns the right operand of the AND expression.
 
Operation op () const override
 Returns the operation for an expression node.
 
std::string ToString () const override
 Get a user-readable string representation.
 
Result< std::shared_ptr< Expression > > Negate () const override
 Returns the negation of this expression, equivalent to not(this).
 
bool Equals (const Expression &other) const override
 Returns whether this expression will accept the same values as another.
 
- Public Member Functions inherited from iceberg::Expression
std::string ToString () const override
 Get a user-readable string representation.
 
virtual bool is_unbound_predicate () const
 
virtual bool is_bound_predicate () const
 
virtual bool is_unbound_aggregate () const
 
virtual bool is_bound_aggregate () const
 

Static Public Member Functions

static Result< std::unique_ptr< And > > Make (std::shared_ptr< Expression > left, std::shared_ptr< Expression > right)
 Creates an And expression from two sub-expressions.
 
template<typename... Args>
requires std::conjunction_v<std::is_same<Args, std::shared_ptr<Expression>>...>
static Result< std::shared_ptr< Expression > > MakeFolded (std::shared_ptr< Expression > left, std::shared_ptr< Expression > right, Args &&... args)
 Creates a folded And expression from two sub-expressions.
 

Additional Inherited Members

- Public Types inherited from iceberg::Expression
enum class  Operation {
  kTrue , kFalse , kIsNull , kNotNull ,
  kIsNan , kNotNan , kLt , kLtEq ,
  kGt , kGtEq , kEq , kNotEq ,
  kIn , kNotIn , kNot , kAnd ,
  kOr , kStartsWith , kNotStartsWith , kCount ,
  kCountNull , kCountStar , kMax , kMin
}
 Operation types for expressions.
 

Detailed Description

An Expression that represents a logical AND operation between two expressions.

This expression evaluates to true if and only if both of its child expressions evaluate to true.

Member Function Documentation

◆ Equals()

bool iceberg::And::Equals ( const Expression other) const
overridevirtual

Returns whether this expression will accept the same values as another.

Parameters
otheranother expression
Returns
true if the expressions are equivalent

Reimplemented from iceberg::Expression.

◆ left()

const std::shared_ptr< Expression > & iceberg::And::left ( ) const
inline

Returns the left operand of the AND expression.

Returns
The left operand of the AND expression

◆ Make()

Result< std::unique_ptr< And > > iceberg::And::Make ( std::shared_ptr< Expression left,
std::shared_ptr< Expression right 
)
static

Creates an And expression from two sub-expressions.

Parameters
leftThe left operand of the AND expression
rightThe right operand of the AND expression

◆ MakeFolded()

template<typename... Args>
requires std::conjunction_v<std::is_same<Args, std::shared_ptr<Expression>>...>
static Result< std::shared_ptr< Expression > > iceberg::And::MakeFolded ( std::shared_ptr< Expression left,
std::shared_ptr< Expression right,
Args &&...  args 
)
inlinestatic

Creates a folded And expression from two sub-expressions.

Parameters
leftThe left operand of the AND expression
rightThe right operand of the AND expression
argsAdditional operands of the AND expression
Returns
A Result containing a shared pointer to the folded And expression, or an error if left or right is nullptr
Note
A folded And expression is an expression that is equivalent to the original expression, but with the And operation removed. For example, (true and x) = x.

◆ Negate()

Result< std::shared_ptr< Expression > > iceberg::And::Negate ( ) const
overridevirtual

Returns the negation of this expression, equivalent to not(this).

Reimplemented from iceberg::Expression.

◆ op()

Operation iceberg::And::op ( ) const
inlineoverridevirtual

Returns the operation for an expression node.

Implements iceberg::Expression.

◆ right()

const std::shared_ptr< Expression > & iceberg::And::right ( ) const
inline

Returns the right operand of the AND expression.

Returns
The right operand of the AND expression

◆ ToString()

std::string iceberg::And::ToString ( ) const
overridevirtual

Get a user-readable string representation.

Implements iceberg::util::Formattable.


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