OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RexInputRenumber< bAllowMissing > Class Template Reference

#include <RexVisitor.h>

+ Inheritance diagram for RexInputRenumber< bAllowMissing >:
+ Collaboration diagram for RexInputRenumber< bAllowMissing >:

Public Member Functions

 RexInputRenumber (const std::unordered_map< size_t, size_t > &new_numbering)
 
RetType visitInput (const RexInput *input) const override
 
- Public Member Functions inherited from RexVisitorBase< std::unique_ptr< const RexScalar > >
virtual std::unique_ptr< const
RexScalar
visit (const RexScalar *rex_scalar) const
 

Private Attributes

const std::unordered_map
< size_t, size_t > & 
old_to_new_idx_
 

Additional Inherited Members

- Protected Types inherited from RexDeepCopyVisitor
using RetType = std::unique_ptr< const RexScalar >
 
- Protected Member Functions inherited from RexDeepCopyVisitor
RetType visitLiteral (const RexLiteral *literal) const override
 
RetType visitSubQuery (const RexSubQuery *subquery) const override
 
RetType visitRef (const RexRef *ref) const override
 
RetType visitOperator (const RexOperator *rex_operator) const override
 
RetType visitWindowFunctionOperator (const RexWindowFunctionOperator *rex_window_function_operator) const
 
RetType visitCase (const RexCase *rex_case) const override
 

Detailed Description

template<bool bAllowMissing>
class RexInputRenumber< bAllowMissing >

Definition at line 208 of file RexVisitor.h.

Constructor & Destructor Documentation

template<bool bAllowMissing>
RexInputRenumber< bAllowMissing >::RexInputRenumber ( const std::unordered_map< size_t, size_t > &  new_numbering)
inline

Definition at line 210 of file RexVisitor.h.

211  : old_to_new_idx_(new_numbering) {}
const std::unordered_map< size_t, size_t > & old_to_new_idx_
Definition: RexVisitor.h:227

Member Function Documentation

template<bool bAllowMissing>
RetType RexInputRenumber< bAllowMissing >::visitInput ( const RexInput input) const
inlineoverridevirtual

Reimplemented from RexDeepCopyVisitor.

Definition at line 212 of file RexVisitor.h.

References CHECK(), RexInput::deepCopy(), RexAbstractInput::getIndex(), RexInput::getSourceNode(), and RexInputRenumber< bAllowMissing >::old_to_new_idx_.

212  {
213  auto renum_it = old_to_new_idx_.find(input->getIndex());
214  if (bAllowMissing) {
215  if (renum_it != old_to_new_idx_.end()) {
216  return std::make_unique<RexInput>(input->getSourceNode(), renum_it->second);
217  } else {
218  return input->deepCopy();
219  }
220  } else {
221  CHECK(renum_it != old_to_new_idx_.end());
222  return std::make_unique<RexInput>(input->getSourceNode(), renum_it->second);
223  }
224  }
const std::unordered_map< size_t, size_t > & old_to_new_idx_
Definition: RexVisitor.h:227
unsigned getIndex() const
CHECK(cgen_state)
std::unique_ptr< RexInput > deepCopy() const
const RelAlgNode * getSourceNode() const

+ Here is the call graph for this function:

Member Data Documentation

template<bool bAllowMissing>
const std::unordered_map<size_t, size_t>& RexInputRenumber< bAllowMissing >::old_to_new_idx_
private

Definition at line 227 of file RexVisitor.h.

Referenced by RexInputRenumber< bAllowMissing >::visitInput().


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