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

#include <Analyzer.h>

+ Inheritance diagram for Analyzer::GeoOperator:
+ Collaboration diagram for Analyzer::GeoOperator:

Public Member Functions

 GeoOperator (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::ExprgetOperand (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

GeoOperator: A geo expression that transforms or accesses an input. Only accesses one primary geo column

Definition at line 1733 of file Analyzer.h.

Constructor & Destructor Documentation

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

Definition at line 3404 of file Analyzer.cpp.

3407  : 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:1753
const std::string name_
Definition: Analyzer.h:1752
GeoExpr(const SQLTypeInfo &ti)
Definition: Analyzer.h:1676

Member Function Documentation

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

Implements Analyzer::Expr.

Definition at line 3409 of file Analyzer.cpp.

References run_benchmark_import::args, args_, i, name_, and Analyzer::Expr::type_info.

3409  {
3410  std::vector<std::shared_ptr<Analyzer::Expr>> args;
3411  for (size_t i = 0; i < args_.size(); i++) {
3412  args.push_back(args_[i]->deep_copy());
3413  }
3414  return makeExpr<GeoOperator>(type_info, name_, args);
3415 }
std::shared_ptr< Analyzer::Expr > deep_copy() const final
Definition: Analyzer.cpp:3409
SQLTypeInfo type_info
Definition: Analyzer.h:176
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
Definition: Analyzer.h:1753
const std::string name_
Definition: Analyzer.h:1752
const std::string& Analyzer::GeoOperator::getName ( ) const
inline

Definition at line 1749 of file Analyzer.h.

References name_.

Referenced by spatial_type::StartEndPoint::codegen(), spatial_type::PointN::codegen(), spatial_type::PointAccessors::codegen(), CodeGenerator::codegenGeoOperator(), spatial_type::Codegen::getName(), spatial_type::Codegen::init(), and operator==().

1749 { return name_; }
const std::string name_
Definition: Analyzer.h:1752

+ Here is the caller graph for this function:

Analyzer::Expr * Analyzer::GeoOperator::getOperand ( const size_t  index) const

Definition at line 3449 of file Analyzer.cpp.

References args_, and CHECK_LT.

Referenced by spatial_type::PointAccessors::getOperand(), spatial_type::StartEndPoint::getOperand(), spatial_type::NPoints::getOperand(), spatial_type::NRings::getOperand(), spatial_type::PointN::getOperand(), spatial_type::PointAccessors::getPositionOperand(), and operator==().

3449  {
3450  CHECK_LT(index, args_.size());
3451  return args_[index].get();
3452 }
#define CHECK_LT(x, y)
Definition: Logger.h:216
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
Definition: Analyzer.h:1753

+ Here is the caller graph for this function:

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

Implements Analyzer::Expr.

Definition at line 3426 of file Analyzer.cpp.

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

3426  {
3427  if (typeid(rhs) != typeid(GeoOperator)) {
3428  return false;
3429  }
3430  const GeoOperator& rhs_go = dynamic_cast<const GeoOperator&>(rhs);
3431  if (getName() != rhs_go.getName()) {
3432  return false;
3433  }
3434  if (rhs_go.size() != size()) {
3435  return false;
3436  }
3437  for (size_t i = 0; i < size(); i++) {
3438  if (args_[i].get() != rhs_go.getOperand(i)) {
3439  return false;
3440  }
3441  }
3442  return true;
3443 }
GeoOperator(const SQLTypeInfo &ti, const std::string &name, const std::vector< std::shared_ptr< Analyzer::Expr >> &args)
Definition: Analyzer.cpp:3404
const std::string & getName() const
Definition: Analyzer.h:1749
size_t size() const
Definition: Analyzer.cpp:3445
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
Definition: Analyzer.h:1753

+ Here is the call graph for this function:

size_t Analyzer::GeoOperator::size ( ) const

Definition at line 3445 of file Analyzer.cpp.

References args_.

Referenced by spatial_type::PointAccessors::getOperand(), spatial_type::StartEndPoint::getOperand(), spatial_type::PointN::getOperand(), and operator==().

3445  {
3446  return args_.size();
3447 }
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
Definition: Analyzer.h:1753

+ Here is the caller graph for this function:

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

Implements Analyzer::Expr.

Definition at line 3417 of file Analyzer.cpp.

References args_, and name_.

Referenced by CodeGenerator::codegenGeoOperator(), and spatial_type::PointAccessors::codegenLoads().

3417  {
3418  std::string str{"(" + name_ + " "};
3419  for (const auto& arg : args_) {
3420  str += arg->toString();
3421  }
3422  str += ")";
3423  return str;
3424 }
const std::vector< std::shared_ptr< Analyzer::Expr > > args_
Definition: Analyzer.h:1753
const std::string name_
Definition: Analyzer.h:1752

+ Here is the caller graph for this function:

Member Data Documentation

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

Definition at line 1753 of file Analyzer.h.

Referenced by deep_copy(), getOperand(), operator==(), size(), and toString().

const std::string Analyzer::GeoOperator::name_
private

Definition at line 1752 of file Analyzer.h.

Referenced by deep_copy(), getName(), and toString().


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