OmniSciDB  ab4938a6a3
RexCase Class Reference

#include <RelAlgDagBuilder.h>

+ Inheritance diagram for RexCase:
+ Collaboration diagram for RexCase:

Public Member Functions

 RexCase (std::vector< std::pair< std::unique_ptr< const RexScalar >, std::unique_ptr< const RexScalar >>> &expr_pair_list, std::unique_ptr< const RexScalar > &else_expr)
 
size_t branchCount () const
 
const RexScalargetWhen (const size_t idx) const
 
const RexScalargetThen (const size_t idx) const
 
const RexScalargetElse () const
 
std::string toString () const override
 
- Public Member Functions inherited from Rex
virtual ~Rex ()
 

Private Attributes

std::vector< std::pair< std::unique_ptr< const RexScalar >, std::unique_ptr< const RexScalar > > > expr_pair_list_
 
std::unique_ptr< const RexScalarelse_expr_
 

Detailed Description

Definition at line 349 of file RelAlgDagBuilder.h.

Constructor & Destructor Documentation

◆ RexCase()

RexCase::RexCase ( std::vector< std::pair< std::unique_ptr< const RexScalar >, std::unique_ptr< const RexScalar >>> &  expr_pair_list,
std::unique_ptr< const RexScalar > &  else_expr 
)
inline

Definition at line 351 of file RelAlgDagBuilder.h.

354  : expr_pair_list_(std::move(expr_pair_list)), else_expr_(std::move(else_expr)) {}
std::unique_ptr< const RexScalar > else_expr_
std::vector< std::pair< std::unique_ptr< const RexScalar >, std::unique_ptr< const RexScalar > > > expr_pair_list_

Member Function Documentation

◆ branchCount()

size_t RexCase::branchCount ( ) const
inline

Definition at line 356 of file RelAlgDagBuilder.h.

Referenced by anonymous_namespace{RelAlgDagBuilder.cpp}::disambiguate_case(), RelAlgTranslator::translateCase(), RexVisitor< const RexScalar *>::visitCase(), and RexDeepCopyVisitor::visitCase().

356 { return expr_pair_list_.size(); }
std::vector< std::pair< std::unique_ptr< const RexScalar >, std::unique_ptr< const RexScalar > > > expr_pair_list_
+ Here is the caller graph for this function:

◆ getElse()

const RexScalar* RexCase::getElse ( ) const
inline

Definition at line 368 of file RelAlgDagBuilder.h.

Referenced by anonymous_namespace{RelAlgDagBuilder.cpp}::disambiguate_case(), RelAlgTranslator::translateCase(), RexVisitor< const RexScalar *>::visitCase(), and RexDeepCopyVisitor::visitCase().

368 { return else_expr_.get(); }
std::unique_ptr< const RexScalar > else_expr_
+ Here is the caller graph for this function:

◆ getThen()

const RexScalar* RexCase::getThen ( const size_t  idx) const
inline

Definition at line 363 of file RelAlgDagBuilder.h.

References CHECK.

Referenced by anonymous_namespace{RelAlgDagBuilder.cpp}::disambiguate_case(), RelAlgTranslator::translateCase(), RexVisitor< const RexScalar *>::visitCase(), and RexDeepCopyVisitor::visitCase().

363  {
364  CHECK(idx < expr_pair_list_.size());
365  return expr_pair_list_[idx].second.get();
366  }
std::vector< std::pair< std::unique_ptr< const RexScalar >, std::unique_ptr< const RexScalar > > > expr_pair_list_
#define CHECK(condition)
Definition: Logger.h:197
+ Here is the caller graph for this function:

◆ getWhen()

const RexScalar* RexCase::getWhen ( const size_t  idx) const
inline

Definition at line 358 of file RelAlgDagBuilder.h.

References CHECK.

Referenced by anonymous_namespace{RelAlgDagBuilder.cpp}::disambiguate_case(), RelAlgTranslator::translateCase(), RexVisitor< const RexScalar *>::visitCase(), and RexDeepCopyVisitor::visitCase().

358  {
359  CHECK(idx < expr_pair_list_.size());
360  return expr_pair_list_[idx].first.get();
361  }
std::vector< std::pair< std::unique_ptr< const RexScalar >, std::unique_ptr< const RexScalar > > > expr_pair_list_
#define CHECK(condition)
Definition: Logger.h:197
+ Here is the caller graph for this function:

◆ toString()

std::string RexCase::toString ( ) const
inlineoverridevirtual

Implements Rex.

Definition at line 370 of file RelAlgDagBuilder.h.

370  {
371  std::string ret = "(RexCase";
372  for (const auto& expr_pair : expr_pair_list_) {
373  ret += " " + expr_pair.first->toString() + " -> " + expr_pair.second->toString();
374  }
375  if (else_expr_) {
376  ret += " else " + else_expr_->toString();
377  }
378  ret += ")";
379  return ret;
380  }
std::unique_ptr< const RexScalar > else_expr_
std::vector< std::pair< std::unique_ptr< const RexScalar >, std::unique_ptr< const RexScalar > > > expr_pair_list_

Member Data Documentation

◆ else_expr_

std::unique_ptr<const RexScalar> RexCase::else_expr_
private

Definition at line 386 of file RelAlgDagBuilder.h.

◆ expr_pair_list_

std::vector< std::pair<std::unique_ptr<const RexScalar>, std::unique_ptr<const RexScalar> > > RexCase::expr_pair_list_
private

Definition at line 385 of file RelAlgDagBuilder.h.


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