OmniSciDB  c07336695a
Analyzer::FunctionOper Class Reference

#include <Analyzer.h>

+ Inheritance diagram for Analyzer::FunctionOper:
+ Collaboration diagram for Analyzer::FunctionOper:

Public Member Functions

 FunctionOper (const SQLTypeInfo &ti, const std::string &name, const std::vector< std::shared_ptr< Analyzer::Expr >> &args)
 
std::string getName () const
 
size_t getArity () const
 
const Analyzer::ExprgetArg (const size_t i) const
 
std::shared_ptr< Analyzer::ExprgetOwnArg (const size_t i) const
 
std::shared_ptr< Analyzer::Exprdeep_copy () const override
 
bool operator== (const Expr &rhs) const override
 
std::string toString () const override
 
- Public Member Functions inherited from Analyzer::Expr
 Expr (SQLTypes t, bool notnull)
 
 Expr (SQLTypes t, int d, bool notnull)
 
 Expr (SQLTypes t, int d, int s, bool notnull)
 
 Expr (const SQLTypeInfo &ti, bool has_agg=false)
 
virtual ~Expr ()
 
const SQLTypeInfoget_type_info () const
 
void set_type_info (const SQLTypeInfo &ti)
 
bool get_contains_agg () const
 
void set_contains_agg (bool a)
 
virtual std::shared_ptr< Analyzer::Expradd_cast (const SQLTypeInfo &new_type_info)
 
virtual void check_group_by (const std::list< std::shared_ptr< Analyzer::Expr >> &groupby) const
 
virtual std::shared_ptr< Analyzer::Exprnormalize_simple_predicate (int &rte_idx) const
 
virtual void group_predicates (std::list< const Expr *> &scan_predicates, std::list< const Expr *> &join_predicates, std::list< const Expr *> &const_predicates) const
 
virtual void collect_rte_idx (std::set< int > &rte_idx_set) const
 
virtual void collect_column_var (std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &colvar_set, bool include_agg) const
 
virtual std::shared_ptr< Analyzer::Exprrewrite_with_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const
 
virtual std::shared_ptr< Analyzer::Exprrewrite_with_child_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const
 
virtual std::shared_ptr< Analyzer::Exprrewrite_agg_to_var (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const
 
virtual void print () const
 
virtual void add_unique (std::list< const Expr *> &expr_list) const
 
virtual void find_expr (bool(*f)(const Expr *), std::list< const Expr *> &expr_list) const
 
std::shared_ptr< Analyzer::Exprdecompress ()
 
virtual void get_domain (DomainSet &domain_set) const
 

Private Attributes

const std::string name_
 
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
 

Additional Inherited Members

- Protected Attributes inherited from Analyzer::Expr
SQLTypeInfo type_info
 
bool contains_agg
 

Detailed Description

Definition at line 1243 of file Analyzer.h.

Constructor & Destructor Documentation

◆ FunctionOper()

Analyzer::FunctionOper::FunctionOper ( const SQLTypeInfo ti,
const std::string &  name,
const std::vector< std::shared_ptr< Analyzer::Expr >> &  args 
)
inline

Definition at line 1245 of file Analyzer.h.

1248  : Expr(ti, false), name_(name), args_(args) {}
Expr(SQLTypes t, bool notnull)
Definition: Analyzer.h:69
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
Definition: Analyzer.h:1271
const std::string name_
Definition: Analyzer.h:1270

Member Function Documentation

◆ deep_copy()

std::shared_ptr< Analyzer::Expr > Analyzer::FunctionOper::deep_copy ( ) const
overridevirtual

Implements Analyzer::Expr.

Reimplemented in Analyzer::FunctionOperWithCustomTypeHandling.

Definition at line 2907 of file Analyzer.cpp.

References Analyzer::InIntegerSet::deep_copy(), and Analyzer::Expr::type_info.

2907  {
2908  std::vector<std::shared_ptr<Analyzer::Expr>> args_copy;
2909  for (size_t i = 0; i < getArity(); ++i) {
2910  args_copy.push_back(getArg(i)->deep_copy());
2911  }
2912  return makeExpr<Analyzer::FunctionOper>(type_info, getName(), args_copy);
2913 }
std::string getName() const
Definition: Analyzer.h:1250
const Analyzer::Expr * getArg(const size_t i) const
Definition: Analyzer.h:1254
size_t getArity() const
Definition: Analyzer.h:1252
SQLTypeInfo type_info
Definition: Analyzer.h:175
std::shared_ptr< Analyzer::Expr > deep_copy() const override
Definition: Analyzer.cpp:2907
+ Here is the call graph for this function:

◆ getArg()

◆ getArity()

◆ getName()

std::string Analyzer::FunctionOper::getName ( ) const
inline

Definition at line 1250 of file Analyzer.h.

Referenced by bind_function(), CodeGenerator::codegenFunctionOperWithCustomTypeHandling(), rewrite_to_date_trunc(), DeepCopyVisitor::visitFunctionOper(), JoinCoveredQualVisitor::visitFunctionOper(), and DeepCopyVisitor::visitFunctionOperWithCustomTypeHandling().

1250 { return name_; }
const std::string name_
Definition: Analyzer.h:1270
+ Here is the caller graph for this function:

◆ getOwnArg()

std::shared_ptr<Analyzer::Expr> Analyzer::FunctionOper::getOwnArg ( const size_t  i) const
inline

Definition at line 1259 of file Analyzer.h.

References CHECK_LT, and operator==().

Referenced by bind_function().

1259  {
1260  CHECK_LT(i, args_.size());
1261  return args_[i];
1262  }
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
Definition: Analyzer.h:1271
#define CHECK_LT(x, y)
Definition: Logger.h:197
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator==()

bool Analyzer::FunctionOper::operator== ( const Expr rhs) const
overridevirtual

Implements Analyzer::Expr.

Reimplemented in Analyzer::FunctionOperWithCustomTypeHandling.

Definition at line 2915 of file Analyzer.cpp.

References Analyzer::Expr::get_type_info(), and Analyzer::Expr::type_info.

2915  {
2916  if (type_info != rhs.get_type_info()) {
2917  return false;
2918  }
2919  const auto rhs_func_oper = dynamic_cast<const FunctionOper*>(&rhs);
2920  if (!rhs_func_oper) {
2921  return false;
2922  }
2923  if (getName() != rhs_func_oper->getName()) {
2924  return false;
2925  }
2926  if (getArity() != rhs_func_oper->getArity()) {
2927  return false;
2928  }
2929  for (size_t i = 0; i < getArity(); ++i) {
2930  if (!(*getArg(i) == *(rhs_func_oper->getArg(i)))) {
2931  return false;
2932  }
2933  }
2934  return true;
2935 }
std::string getName() const
Definition: Analyzer.h:1250
const Analyzer::Expr * getArg(const size_t i) const
Definition: Analyzer.h:1254
size_t getArity() const
Definition: Analyzer.h:1252
SQLTypeInfo type_info
Definition: Analyzer.h:175
FunctionOper(const SQLTypeInfo &ti, const std::string &name, const std::vector< std::shared_ptr< Analyzer::Expr >> &args)
Definition: Analyzer.h:1245
+ Here is the call graph for this function:

◆ toString()

std::string Analyzer::FunctionOper::toString ( ) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 2937 of file Analyzer.cpp.

References Analyzer::InIntegerSet::arg.

2937  {
2938  std::string str{"(" + name_ + " "};
2939  for (const auto arg : args_) {
2940  str += arg->toString();
2941  }
2942  str += ")";
2943  return str;
2944 }
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
Definition: Analyzer.h:1271
const std::string name_
Definition: Analyzer.h:1270

Member Data Documentation

◆ args_

const std::vector<std::shared_ptr<Analyzer::Expr> > Analyzer::FunctionOper::args_
private

Definition at line 1271 of file Analyzer.h.

◆ name_

const std::string Analyzer::FunctionOper::name_
private

Definition at line 1270 of file Analyzer.h.


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