OmniSciDB  c0231cc57d
 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 (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 (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

const std::string name_
 

Additional Inherited Members

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

Detailed Description

Definition at line 436 of file RelAlgDag.h.

Member Typedef Documentation

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

Definition at line 438 of file RelAlgDag.h.

Definition at line 439 of file RelAlgDag.h.

Constructor & Destructor Documentation

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

Definition at line 441 of file RelAlgDag.h.

Referenced by getDisambiguated(), and toHash().

444  : RexOperator(kFUNCTION, operands, ti), name_(name) {}
const std::string name_
Definition: RelAlgDag.h:477
RexOperator(const SQLOps op, std::vector< std::unique_ptr< const RexScalar >> &operands, const SQLTypeInfo &type)
Definition: RelAlgDag.h:235
string name
Definition: setup.in.py:72

+ Here is the caller graph for this function:

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 446 of file RelAlgDag.h.

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

447  {
448  return std::unique_ptr<const RexOperator>(
449  new RexFunctionOperator(name_, operands, getType()));
450  }
const std::string name_
Definition: RelAlgDag.h:477
const SQLTypeInfo & getType() const
Definition: RelAlgDag.h:259
RexFunctionOperator(const std::string &name, ConstRexScalarPtrVector &operands, const SQLTypeInfo &ti)
Definition: RelAlgDag.h:441

+ Here is the call graph for this function:

size_t RexFunctionOperator::toHash ( ) const
inlineoverridevirtual

Reimplemented from RexOperator.

Reimplemented in RexWindowFunctionOperator.

Definition at line 463 of file RelAlgDag.h.

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

463  {
464  if (!hash_) {
465  hash_ = typeid(RexFunctionOperator).hash_code();
466  boost::hash_combine(*hash_, ::toString(op_));
467  boost::hash_combine(*hash_, getType().get_type_name());
468  for (auto& operand : operands_) {
469  boost::hash_combine(*hash_, operand->toHash());
470  }
471  boost::hash_combine(*hash_, name_);
472  }
473  return *hash_;
474  }
const std::string name_
Definition: RelAlgDag.h:477
const SQLTypeInfo & getType() const
Definition: RelAlgDag.h:259
const SQLOps op_
Definition: RelAlgDag.h:283
std::vector< std::unique_ptr< const RexScalar > > operands_
Definition: RelAlgDag.h:284
std::optional< size_t > hash_
Definition: RelAlgDag.h:62
RexFunctionOperator(const std::string &name, ConstRexScalarPtrVector &operands, const SQLTypeInfo &ti)
Definition: RelAlgDag.h:441
std::string toString(RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
Definition: RelAlgDag.h:454

+ 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 454 of file RelAlgDag.h.

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

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

455  {
456  auto ret = cat(::typeName(this), "(", name_, ", operands=");
457  for (auto& operand : operands_) {
458  ret += operand->toString(config) + " ";
459  }
460  return cat(ret, ")");
461  }
std::string cat(Ts &&...args)
const std::string name_
Definition: RelAlgDag.h:477
std::vector< std::unique_ptr< const RexScalar > > operands_
Definition: RelAlgDag.h:284
std::string typeName(const T *v)
Definition: toString.h:103

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

const std::string RexFunctionOperator::name_
private

Definition at line 477 of file RelAlgDag.h.

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


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