OmniSciDB  8a228a1076
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 ()
 
std::shared_ptr< Analyzer::Exprget_shared_ptr ()
 
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 1352 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 1354 of file Analyzer.h.

1357  : Expr(ti, false), name_(name), args_(args) {}
Expr(SQLTypes t, bool notnull)
Definition: Analyzer.h:70
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
Definition: Analyzer.h:1380
const std::string name_
Definition: Analyzer.h:1379

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 3155 of file Analyzer.cpp.

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

3155  {
3156  std::vector<std::shared_ptr<Analyzer::Expr>> args_copy;
3157  for (size_t i = 0; i < getArity(); ++i) {
3158  args_copy.push_back(getArg(i)->deep_copy());
3159  }
3160  return makeExpr<Analyzer::FunctionOper>(type_info, getName(), args_copy);
3161 }
std::string getName() const
Definition: Analyzer.h:1359
const Analyzer::Expr * getArg(const size_t i) const
Definition: Analyzer.h:1363
size_t getArity() const
Definition: Analyzer.h:1361
SQLTypeInfo type_info
Definition: Analyzer.h:177
std::shared_ptr< Analyzer::Expr > deep_copy() const override
Definition: Analyzer.cpp:3155
+ Here is the call graph for this function:

◆ getArg()

◆ getArity()

◆ getName()

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

◆ getOwnArg()

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

Definition at line 1368 of file Analyzer.h.

References CHECK_LT, and operator==().

Referenced by bind_function().

1368  {
1369  CHECK_LT(i, args_.size());
1370  return args_[i];
1371  }
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
Definition: Analyzer.h:1380
#define CHECK_LT(x, y)
Definition: Logger.h:207
+ 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 3163 of file Analyzer.cpp.

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

3163  {
3164  if (type_info != rhs.get_type_info()) {
3165  return false;
3166  }
3167  const auto rhs_func_oper = dynamic_cast<const FunctionOper*>(&rhs);
3168  if (!rhs_func_oper) {
3169  return false;
3170  }
3171  if (getName() != rhs_func_oper->getName()) {
3172  return false;
3173  }
3174  if (getArity() != rhs_func_oper->getArity()) {
3175  return false;
3176  }
3177  for (size_t i = 0; i < getArity(); ++i) {
3178  if (!(*getArg(i) == *(rhs_func_oper->getArg(i)))) {
3179  return false;
3180  }
3181  }
3182  return true;
3183 }
std::string getName() const
Definition: Analyzer.h:1359
const Analyzer::Expr * getArg(const size_t i) const
Definition: Analyzer.h:1363
size_t getArity() const
Definition: Analyzer.h:1361
SQLTypeInfo type_info
Definition: Analyzer.h:177
FunctionOper(const SQLTypeInfo &ti, const std::string &name, const std::vector< std::shared_ptr< Analyzer::Expr >> &args)
Definition: Analyzer.h:1354
+ Here is the call graph for this function:

◆ toString()

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

Implements Analyzer::Expr.

Definition at line 3185 of file Analyzer.cpp.

References Analyzer::InIntegerSet::arg.

3185  {
3186  std::string str{"(" + name_ + " "};
3187  for (const auto& arg : args_) {
3188  str += arg->toString();
3189  }
3190  str += ")";
3191  return str;
3192 }
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
Definition: Analyzer.h:1380
const std::string name_
Definition: Analyzer.h:1379

Member Data Documentation

◆ args_

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

Definition at line 1380 of file Analyzer.h.

◆ name_

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

Definition at line 1379 of file Analyzer.h.


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