OmniSciDB  06b3bd477c
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 468 of file ParserNode.h.

Constructor & Destructor Documentation

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

Definition at line 470 of file ParserNode.h.

470 : arg(a) {}
std::unique_ptr< Expr > arg
Definition: ParserNode.h:479

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 475 of file ParserNode.cpp.

References run_benchmark_import::result.

478  {
479  auto arg_expr = arg->analyze(catalog, query, allow_tlist_ref);
480  if (!arg_expr->get_type_info().is_array()) {
481  throw std::runtime_error(
482  "expression in cardinality clause must be of an array type.");
483  }
484  std::shared_ptr<Analyzer::Expr> result =
485  makeExpr<Analyzer::CardinalityExpr>(arg_expr->decompress());
486  return result;
487 }
std::unique_ptr< Expr > arg
Definition: ParserNode.h:479
const Expr* Parser::CardinalityExpr::get_arg ( ) const
inline

Definition at line 471 of file ParserNode.h.

References arg.

471 { return arg.get(); }
std::unique_ptr< Expr > arg
Definition: ParserNode.h:479
std::string Parser::CardinalityExpr::to_string ( ) const
overridevirtual

Implements Parser::Expr.

Definition at line 1381 of file ParserNode.cpp.

1381  {
1382  std::string str = "CARDINALITY(" + arg->to_string() + ")";
1383  return str;
1384 }
std::unique_ptr< Expr > arg
Definition: ParserNode.h:479

Member Data Documentation

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

Definition at line 479 of file ParserNode.h.

Referenced by get_arg().


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