OmniSciDB  a987f07e93
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RexFunctionOperator Class Reference

#include <RelAlgDag.h>

+ Inheritance diagram for RexFunctionOperator:
+ Collaboration diagram for RexFunctionOperator:

Public Types

using ConstRexScalarPtr = std::unique_ptr< const RexScalar >
 
using ConstRexScalarPtrVector = std::vector< ConstRexScalarPtr >
 

Public Member Functions

 RexFunctionOperator ()=default
 
 RexFunctionOperator (const std::string &name, ConstRexScalarPtrVector &operands, const SQLTypeInfo &ti)
 
std::unique_ptr< const
RexOperator
getDisambiguated (std::vector< std::unique_ptr< const RexScalar >> &operands) const override
 
const std::string & getName () const
 
std::string toString (RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
 
size_t toHash () const override
 
- Public Member Functions inherited from RexOperator
 RexOperator ()
 
 RexOperator (const SQLOps op, std::vector< std::unique_ptr< const RexScalar >> &operands, const SQLTypeInfo &type)
 
size_t size () const
 
const RexScalargetOperand (const size_t idx) const
 
const RexScalargetOperandAndRelease (const size_t idx) const
 
SQLOps getOperator () const
 
const SQLTypeInfogetType () const
 
- Public Member Functions inherited from Rex
virtual ~Rex ()
 

Private Attributes

std::string name_
 

Friends

struct RelAlgDagSerializer
 

Additional Inherited Members

- Protected Attributes inherited from RexOperator
SQLOps op_
 
std::vector< std::unique_ptr
< const RexScalar > > 
operands_
 
SQLTypeInfo type_
 
- Protected Attributes inherited from Rex
std::optional< size_t > hash_
 

Detailed Description

Definition at line 481 of file RelAlgDag.h.

Member Typedef Documentation

using RexFunctionOperator::ConstRexScalarPtr = std::unique_ptr<const RexScalar>

Definition at line 483 of file RelAlgDag.h.

Definition at line 484 of file RelAlgDag.h.

Constructor & Destructor Documentation

RexFunctionOperator::RexFunctionOperator ( )
default

Referenced by getDisambiguated(), and toHash().

+ Here is the caller graph for this function:

RexFunctionOperator::RexFunctionOperator ( const std::string &  name,
ConstRexScalarPtrVector operands,
const SQLTypeInfo ti 
)
inline

Definition at line 489 of file RelAlgDag.h.

492  : RexOperator(kFUNCTION, operands, ti), name_(name) {}
std::string name_
Definition: RelAlgDag.h:525
string name
Definition: setup.in.py:72

Member Function Documentation

std::unique_ptr<const RexOperator> RexFunctionOperator::getDisambiguated ( std::vector< std::unique_ptr< const RexScalar >> &  operands) const
inlineoverridevirtual

Reimplemented from RexOperator.

Definition at line 494 of file RelAlgDag.h.

References RexOperator::getType(), name_, and RexFunctionOperator().

495  {
496  return std::unique_ptr<const RexOperator>(
497  new RexFunctionOperator(name_, operands, getType()));
498  }
RexFunctionOperator()=default
const SQLTypeInfo & getType() const
Definition: RelAlgDag.h:284
std::string name_
Definition: RelAlgDag.h:525

+ Here is the call graph for this function:

size_t RexFunctionOperator::toHash ( ) const
inlineoverridevirtual

Reimplemented from RexOperator.

Reimplemented in RexWindowFunctionOperator.

Definition at line 511 of file RelAlgDag.h.

References RexOperator::getType(), Rex::hash_, name_, RexOperator::op_, RexOperator::operands_, RexFunctionOperator(), and toString().

511  {
512  if (!hash_) {
513  hash_ = typeid(RexFunctionOperator).hash_code();
514  boost::hash_combine(*hash_, ::toString(op_));
515  boost::hash_combine(*hash_, getType().get_type_name());
516  for (auto& operand : operands_) {
517  boost::hash_combine(*hash_, operand->toHash());
518  }
519  boost::hash_combine(*hash_, name_);
520  }
521  return *hash_;
522  }
RexFunctionOperator()=default
const SQLTypeInfo & getType() const
Definition: RelAlgDag.h:284
std::vector< std::unique_ptr< const RexScalar > > operands_
Definition: RelAlgDag.h:309
std::optional< size_t > hash_
Definition: RelAlgDag.h:62
std::string name_
Definition: RelAlgDag.h:525
std::string toString(RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
Definition: RelAlgDag.h:502
SQLOps op_
Definition: RelAlgDag.h:308

+ Here is the call graph for this function:

std::string RexFunctionOperator::toString ( RelRexToStringConfig  config = RelRexToStringConfig::defaults()) const
inlineoverridevirtual

Reimplemented from RexOperator.

Reimplemented in RexWindowFunctionOperator.

Definition at line 502 of file RelAlgDag.h.

References cat(), name_, RexOperator::operands_, and typeName().

Referenced by toHash(), and RelAlgTranslator::translateGeoProjection().

503  {
504  auto ret = cat(::typeName(this), "(", name_, ", operands=");
505  for (auto& operand : operands_) {
506  ret += operand->toString(config) + " ";
507  }
508  return cat(ret, ")");
509  }
std::string cat(Ts &&...args)
std::vector< std::unique_ptr< const RexScalar > > operands_
Definition: RelAlgDag.h:309
std::string typeName(const T *v)
Definition: toString.h:103
std::string name_
Definition: RelAlgDag.h:525

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Friends And Related Function Documentation

friend struct RelAlgDagSerializer
friend

Definition at line 527 of file RelAlgDag.h.

Member Data Documentation

std::string RexFunctionOperator::name_
private

Definition at line 525 of file RelAlgDag.h.

Referenced by getDisambiguated(), getName(), toHash(), and toString().


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