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

#include <RelAlgDag.h>

+ Inheritance diagram for RexAgg:
+ Collaboration diagram for RexAgg:

Public Member Functions

 RexAgg ()
 
 RexAgg (const SQLAgg agg, const bool distinct, const SQLTypeInfo &type, const std::vector< size_t > &operands)
 
std::string toString (RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
 
size_t toHash () const override
 
SQLAgg getKind () const
 
bool isDistinct () const
 
size_t size () const
 
size_t getOperand (size_t idx) const
 
const SQLTypeInfogetType () const
 
std::unique_ptr< RexAggdeepCopy () const
 
- Public Member Functions inherited from Rex
virtual ~Rex ()
 

Private Attributes

SQLAgg agg_
 
bool distinct_
 
SQLTypeInfo type_
 
std::vector< size_t > operands_
 

Friends

struct RelAlgDagSerializer
 

Additional Inherited Members

- Protected Attributes inherited from Rex
std::optional< size_t > hash_
 

Detailed Description

Definition at line 775 of file RelAlgDag.h.

Constructor & Destructor Documentation

RexAgg::RexAgg ( )
inline

Definition at line 778 of file RelAlgDag.h.

Referenced by toHash().

778 : agg_(SQLAgg::kINVALID_AGG), distinct_(false) {}
bool distinct_
Definition: RelAlgDag.h:829
SQLAgg agg_
Definition: RelAlgDag.h:828

+ Here is the caller graph for this function:

RexAgg::RexAgg ( const SQLAgg  agg,
const bool  distinct,
const SQLTypeInfo type,
const std::vector< size_t > &  operands 
)
inline

Definition at line 780 of file RelAlgDag.h.

784  : agg_(agg), distinct_(distinct), type_(type), operands_(operands) {}
std::vector< size_t > operands_
Definition: RelAlgDag.h:831
bool distinct_
Definition: RelAlgDag.h:829
SQLAgg agg_
Definition: RelAlgDag.h:828
SQLTypeInfo type_
Definition: RelAlgDag.h:830

Member Function Documentation

std::unique_ptr<RexAgg> RexAgg::deepCopy ( ) const
inline

Definition at line 823 of file RelAlgDag.h.

References agg_, distinct_, operands_, and type_.

823  {
824  return std::make_unique<RexAgg>(agg_, distinct_, type_, operands_);
825  }
std::vector< size_t > operands_
Definition: RelAlgDag.h:831
bool distinct_
Definition: RelAlgDag.h:829
SQLAgg agg_
Definition: RelAlgDag.h:828
SQLTypeInfo type_
Definition: RelAlgDag.h:830
SQLAgg RexAgg::getKind ( ) const
inline

Definition at line 813 of file RelAlgDag.h.

References agg_.

Referenced by RelAlgTranslator::translateAggregateRex().

813 { return agg_; }
SQLAgg agg_
Definition: RelAlgDag.h:828

+ Here is the caller graph for this function:

size_t RexAgg::getOperand ( size_t  idx) const
inline

Definition at line 819 of file RelAlgDag.h.

References operands_.

Referenced by RelAlgTranslator::translateAggregateRex().

819 { return operands_[idx]; }
std::vector< size_t > operands_
Definition: RelAlgDag.h:831

+ Here is the caller graph for this function:

const SQLTypeInfo& RexAgg::getType ( ) const
inline

Definition at line 821 of file RelAlgDag.h.

References type_.

821 { return type_; }
SQLTypeInfo type_
Definition: RelAlgDag.h:830
bool RexAgg::isDistinct ( ) const
inline

Definition at line 815 of file RelAlgDag.h.

References distinct_.

Referenced by RelAlgTranslator::translateAggregateRex().

815 { return distinct_; }
bool distinct_
Definition: RelAlgDag.h:829

+ Here is the caller graph for this function:

size_t RexAgg::size ( ) const
inline

Definition at line 817 of file RelAlgDag.h.

References operands_.

Referenced by RelAlgTranslator::translateAggregateRex().

817 { return operands_.size(); }
std::vector< size_t > operands_
Definition: RelAlgDag.h:831

+ Here is the caller graph for this function:

size_t RexAgg::toHash ( ) const
inlineoverridevirtual

Implements Rex.

Definition at line 800 of file RelAlgDag.h.

References agg_, distinct_, SQLTypeInfo::get_type_name(), Rex::hash_, operands_, RexAgg(), and type_.

800  {
801  if (!hash_) {
802  hash_ = typeid(RexAgg).hash_code();
803  for (auto& operand : operands_) {
804  boost::hash_combine(*hash_, operand);
805  }
806  boost::hash_combine(*hash_, agg_);
807  boost::hash_combine(*hash_, distinct_);
808  boost::hash_combine(*hash_, type_.get_type_name());
809  }
810  return *hash_;
811  }
std::vector< size_t > operands_
Definition: RelAlgDag.h:831
std::optional< size_t > hash_
Definition: RelAlgDag.h:62
bool distinct_
Definition: RelAlgDag.h:829
SQLAgg agg_
Definition: RelAlgDag.h:828
SQLTypeInfo type_
Definition: RelAlgDag.h:830
std::string get_type_name() const
Definition: sqltypes.h:504
RexAgg()
Definition: RelAlgDag.h:778

+ Here is the call graph for this function:

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

Implements Rex.

Definition at line 786 of file RelAlgDag.h.

References agg_, cat(), distinct_, SQLTypeInfo::get_type_name(), operands_, to_string(), type_, and typeName().

787  {
788  return cat(::typeName(this),
789  "(agg=",
791  ", distinct=",
793  ", type=",
795  ", operands=",
797  ")");
798  }
std::string cat(Ts &&...args)
std::string to_string(char const *&&v)
std::vector< size_t > operands_
Definition: RelAlgDag.h:831
bool distinct_
Definition: RelAlgDag.h:829
SQLAgg agg_
Definition: RelAlgDag.h:828
std::string toString(RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
Definition: RelAlgDag.h:786
SQLTypeInfo type_
Definition: RelAlgDag.h:830
std::string get_type_name() const
Definition: sqltypes.h:504
std::string typeName(const T *v)
Definition: toString.h:103

+ Here is the call graph for this function:

Friends And Related Function Documentation

friend struct RelAlgDagSerializer
friend

Definition at line 833 of file RelAlgDag.h.

Member Data Documentation

SQLAgg RexAgg::agg_
private

Definition at line 828 of file RelAlgDag.h.

Referenced by deepCopy(), getKind(), toHash(), and toString().

bool RexAgg::distinct_
private

Definition at line 829 of file RelAlgDag.h.

Referenced by deepCopy(), isDistinct(), toHash(), and toString().

std::vector<size_t> RexAgg::operands_
private

Definition at line 831 of file RelAlgDag.h.

Referenced by deepCopy(), getOperand(), size(), toHash(), and toString().

SQLTypeInfo RexAgg::type_
private

Definition at line 830 of file RelAlgDag.h.

Referenced by deepCopy(), getType(), toHash(), and toString().


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