OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RexCase Class Reference

#include <RelAlgAbstractInterpreter.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 352 of file RelAlgAbstractInterpreter.h.

Constructor & Destructor Documentation

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 354 of file RelAlgAbstractInterpreter.h.

357  : 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

size_t RexCase::branchCount ( ) const
inline

Definition at line 359 of file RelAlgAbstractInterpreter.h.

References expr_pair_list_.

Referenced by anonymous_namespace{RelAlgAbstractInterpreter.cpp}::disambiguate_case(), RelAlgTranslator::translateCase(), RexVisitor< std::unordered_set< const RexInput * > >::visitCase(), RexDeepCopyVisitor::visitCase(), anonymous_namespace{RelAlgAbstractInterpreter.cpp}::WindowFunctionDetectionVisitor::visitCase(), and anonymous_namespace{RelAlgAbstractInterpreter.cpp}::RexWindowFuncReplacementVisitor::visitCase().

359 { 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:

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

Definition at line 366 of file RelAlgAbstractInterpreter.h.

References CHECK(), and expr_pair_list_.

Referenced by anonymous_namespace{RelAlgAbstractInterpreter.cpp}::disambiguate_case(), RelAlgTranslator::translateCase(), RexVisitor< std::unordered_set< const RexInput * > >::visitCase(), RexDeepCopyVisitor::visitCase(), anonymous_namespace{RelAlgAbstractInterpreter.cpp}::WindowFunctionDetectionVisitor::visitCase(), and anonymous_namespace{RelAlgAbstractInterpreter.cpp}::RexWindowFuncReplacementVisitor::visitCase().

366  {
367  CHECK(idx < expr_pair_list_.size());
368  return expr_pair_list_[idx].second.get();
369  }
CHECK(cgen_state)
std::vector< std::pair< std::unique_ptr< const RexScalar >, std::unique_ptr< const RexScalar > > > expr_pair_list_

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 361 of file RelAlgAbstractInterpreter.h.

References CHECK(), and expr_pair_list_.

Referenced by anonymous_namespace{RelAlgAbstractInterpreter.cpp}::disambiguate_case(), RelAlgTranslator::translateCase(), RexVisitor< std::unordered_set< const RexInput * > >::visitCase(), RexDeepCopyVisitor::visitCase(), anonymous_namespace{RelAlgAbstractInterpreter.cpp}::WindowFunctionDetectionVisitor::visitCase(), and anonymous_namespace{RelAlgAbstractInterpreter.cpp}::RexWindowFuncReplacementVisitor::visitCase().

361  {
362  CHECK(idx < expr_pair_list_.size());
363  return expr_pair_list_[idx].first.get();
364  }
CHECK(cgen_state)
std::vector< std::pair< std::unique_ptr< const RexScalar >, std::unique_ptr< const RexScalar > > > expr_pair_list_

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Implements Rex.

Definition at line 373 of file RelAlgAbstractInterpreter.h.

References else_expr_, and expr_pair_list_.

373  {
374  std::string ret = "(RexCase";
375  for (const auto& expr_pair : expr_pair_list_) {
376  ret += " " + expr_pair.first->toString() + " -> " + expr_pair.second->toString();
377  }
378  if (else_expr_) {
379  ret += " else " + else_expr_->toString();
380  }
381  ret += ")";
382  return ret;
383  }
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

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

Definition at line 389 of file RelAlgAbstractInterpreter.h.

Referenced by getElse(), and toString().

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

Definition at line 388 of file RelAlgAbstractInterpreter.h.

Referenced by branchCount(), getThen(), getWhen(), and toString().


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