OmniSciDB  ba1bac9284
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Analyzer::GeoFunctionOperator Class Reference

#include <Analyzer.h>

+ Inheritance diagram for Analyzer::GeoFunctionOperator:
+ Collaboration diagram for Analyzer::GeoFunctionOperator:

Public Member Functions

 GeoFunctionOperator (const SQLTypeInfo &ti, const std::string &name, const std::vector< std::shared_ptr< Analyzer::Expr >> &args)
 
std::shared_ptr< Analyzer::Exprdeep_copy () const final
 
std::string toString () const final
 
bool operator== (const Expr &) const final
 
size_t size () const
 
Analyzer::ExprgetArg (const size_t index) const
 
const std::string & getName () const
 
- Public Member Functions inherited from Analyzer::GeoExpr
 GeoExpr (const SQLTypeInfo &ti)
 
- 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::Expr
add_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::Expr
normalize_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::Expr
rewrite_with_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const
 
virtual std::shared_ptr
< Analyzer::Expr
rewrite_with_child_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const
 
virtual std::shared_ptr
< Analyzer::Expr
rewrite_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

GeoFunctionOperator: A geospatial function that takes one or more geo inputs and outputs a scalar or geo output. Similar to an operator, but requires one or more external function calls.

Definition at line 1761 of file Analyzer.h.

Constructor & Destructor Documentation

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

Definition at line 3454 of file Analyzer.cpp.

3458  : GeoExpr(ti), name_(name), args_(args) {}
string name
Definition: setup.in.py:72
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
Definition: Analyzer.h:1781
const std::string name_
Definition: Analyzer.h:1780
GeoExpr(const SQLTypeInfo &ti)
Definition: Analyzer.h:1676

Member Function Documentation

std::shared_ptr< Analyzer::Expr > Analyzer::GeoFunctionOperator::deep_copy ( ) const
finalvirtual

Implements Analyzer::Expr.

Definition at line 3460 of file Analyzer.cpp.

References getArg(), getName(), i, size(), and Analyzer::Expr::type_info.

3460  {
3461  std::vector<std::shared_ptr<Analyzer::Expr>> args_copy;
3462  for (size_t i = 0; i < size(); ++i) {
3463  args_copy.push_back(getArg(i)->deep_copy());
3464  }
3465  return makeExpr<Analyzer::GeoFunctionOperator>(type_info, getName(), args_copy);
3466 }
SQLTypeInfo type_info
Definition: Analyzer.h:176
Analyzer::Expr * getArg(const size_t index) const
Definition: Analyzer.cpp:3500
std::shared_ptr< Analyzer::Expr > deep_copy() const final
Definition: Analyzer.cpp:3460
const std::string & getName() const
Definition: Analyzer.h:1777

+ Here is the call graph for this function:

Analyzer::Expr * Analyzer::GeoFunctionOperator::getArg ( const size_t  index) const

Definition at line 3500 of file Analyzer.cpp.

References args_, and CHECK_LT.

Referenced by CodeGenerator::codegenGeoFunctionOperator(), deep_copy(), and operator==().

3500  {
3501  CHECK_LT(index, args_.size());
3502  return args_[index].get();
3503 }
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
Definition: Analyzer.h:1781
#define CHECK_LT(x, y)
Definition: Logger.h:216

+ Here is the caller graph for this function:

const std::string& Analyzer::GeoFunctionOperator::getName ( ) const
inline

Definition at line 1777 of file Analyzer.h.

References name_.

Referenced by CodeGenerator::codegenGeoFunctionOperator(), deep_copy(), and operator==().

1777 { return name_; }
const std::string name_
Definition: Analyzer.h:1780

+ Here is the caller graph for this function:

bool Analyzer::GeoFunctionOperator::operator== ( const Expr rhs) const
finalvirtual

Implements Analyzer::Expr.

Definition at line 3477 of file Analyzer.cpp.

References args_, getArg(), getName(), i, and size().

3477  {
3478  if (typeid(rhs) != typeid(GeoFunctionOperator)) {
3479  return false;
3480  }
3481  const GeoFunctionOperator& rhs_go = dynamic_cast<const GeoFunctionOperator&>(rhs);
3482  if (getName() != rhs_go.getName()) {
3483  return false;
3484  }
3485  if (rhs_go.size() != size()) {
3486  return false;
3487  }
3488  for (size_t i = 0; i < size(); i++) {
3489  if (args_[i].get() != rhs_go.getArg(i)) {
3490  return false;
3491  }
3492  }
3493  return true;
3494 }
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
Definition: Analyzer.h:1781
const std::string & getName() const
Definition: Analyzer.h:1777
GeoFunctionOperator(const SQLTypeInfo &ti, const std::string &name, const std::vector< std::shared_ptr< Analyzer::Expr >> &args)
Definition: Analyzer.cpp:3454

+ Here is the call graph for this function:

size_t Analyzer::GeoFunctionOperator::size ( ) const

Definition at line 3496 of file Analyzer.cpp.

References args_.

Referenced by deep_copy(), and operator==().

3496  {
3497  return args_.size();
3498 }
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
Definition: Analyzer.h:1781

+ Here is the caller graph for this function:

std::string Analyzer::GeoFunctionOperator::toString ( ) const
finalvirtual

Implements Analyzer::Expr.

Definition at line 3468 of file Analyzer.cpp.

References args_, and name_.

Referenced by CodeGenerator::codegenGeoFunctionOperator().

3468  {
3469  std::string str{"(" + name_ + " "};
3470  for (const auto& arg : args_) {
3471  str += arg->toString();
3472  }
3473  str += ")";
3474  return str;
3475 }
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
Definition: Analyzer.h:1781
const std::string name_
Definition: Analyzer.h:1780

+ Here is the caller graph for this function:

Member Data Documentation

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

Definition at line 1781 of file Analyzer.h.

Referenced by getArg(), operator==(), size(), and toString().

const std::string Analyzer::GeoFunctionOperator::name_
private

Definition at line 1780 of file Analyzer.h.

Referenced by getName(), and toString().


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