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

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

#include <expression.h>

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

Public Member Functions

const std::shared_ptr< Expression > & left () const
 Returns the left operand of the OR expression.
 
const std::shared_ptr< Expression > & right () const
 Returns the right operand of the OR 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
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< Or > > Make (std::shared_ptr< Expression > left, std::shared_ptr< Expression > right)
 Creates an Or 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 Or 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 OR operation between two expressions.

This expression evaluates to true if at least one of its child expressions evaluates to true.

Member Function Documentation

◆ Equals()

bool iceberg::Or::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::Or::left ( ) const
inline

Returns the left operand of the OR expression.

Returns
The left operand of the OR expression

◆ Make()

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

Creates an Or expression from two sub-expressions.

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

◆ MakeFolded()

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

Creates a folded Or expression from two sub-expressions.

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

◆ Negate()

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

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

Reimplemented from iceberg::Expression.

◆ op()

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

Returns the operation for an expression node.

Implements iceberg::Expression.

◆ right()

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

Returns the right operand of the OR expression.

Returns
The right operand of the OR expression

◆ ToString()

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

Get a user-readable string representation.

Reimplemented from iceberg::Expression.


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