OmniSciDB  d2f719934e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Parser::CardinalityExpr Class Reference

#include <ParserNode.h>

+ Inheritance diagram for Parser::CardinalityExpr:
+ Collaboration diagram for Parser::CardinalityExpr:

Public Member Functions

 CardinalityExpr (Expr *a)
 
const Exprget_arg () const
 
std::shared_ptr< Analyzer::Expranalyze (const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query, TlistRefType allow_tlist_ref=TLIST_NONE) const override
 
std::string to_string () const override
 
- Public Member Functions inherited from Parser::Node
virtual ~Node ()
 

Private Attributes

std::unique_ptr< Exprarg_
 

Additional Inherited Members

- Public Types inherited from Parser::Expr
enum  TlistRefType { TLIST_NONE, TLIST_REF, TLIST_COPY }
 

Detailed Description

Definition at line 472 of file ParserNode.h.

Constructor & Destructor Documentation

Parser::CardinalityExpr::CardinalityExpr ( Expr a)
inline

Definition at line 474 of file ParserNode.h.

474 : arg_(a) {}
constexpr double a
Definition: Utm.h:33
std::unique_ptr< Expr > arg_
Definition: ParserNode.h:483

Member Function Documentation

std::shared_ptr< Analyzer::Expr > Parser::CardinalityExpr::analyze ( const Catalog_Namespace::Catalog catalog,
Analyzer::Query query,
TlistRefType  allow_tlist_ref = TLIST_NONE 
) const
overridevirtual

Implements Parser::Expr.

Definition at line 494 of file ParserNode.cpp.

References run_benchmark_import::result.

497  {
498  auto arg_expr = arg_->analyze(catalog, query, allow_tlist_ref);
499  if (!arg_expr->get_type_info().is_array()) {
500  throw std::runtime_error(
501  "expression in cardinality clause must be of an array type.");
502  }
503  std::shared_ptr<Analyzer::Expr> result =
504  makeExpr<Analyzer::CardinalityExpr>(arg_expr->decompress());
505  return result;
506 }
std::unique_ptr< Expr > arg_
Definition: ParserNode.h:483
const Expr* Parser::CardinalityExpr::get_arg ( ) const
inline

Definition at line 475 of file ParserNode.h.

References arg_.

475 { return arg_.get(); }
std::unique_ptr< Expr > arg_
Definition: ParserNode.h:483
std::string Parser::CardinalityExpr::to_string ( ) const
overridevirtual

Implements Parser::Expr.

Definition at line 1528 of file ParserNode.cpp.

1528  {
1529  std::string str = "CARDINALITY(" + arg_->to_string() + ")";
1530  return str;
1531 }
std::unique_ptr< Expr > arg_
Definition: ParserNode.h:483

Member Data Documentation

std::unique_ptr<Expr> Parser::CardinalityExpr::arg_
private

Definition at line 483 of file ParserNode.h.

Referenced by get_arg().


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