OmniSciDB  b24e664e58
 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 484 of file ParserNode.h.

Constructor & Destructor Documentation

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

Definition at line 486 of file ParserNode.h.

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

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

References run_benchmark_import::result.

461  {
462  auto arg_expr = arg->analyze(catalog, query, allow_tlist_ref);
463  if (!arg_expr->get_type_info().is_array()) {
464  throw std::runtime_error(
465  "expression in cardinality clause must be of an array type.");
466  }
467  std::shared_ptr<Analyzer::Expr> result =
468  makeExpr<Analyzer::CardinalityExpr>(arg_expr->decompress());
469  return result;
470 }
std::unique_ptr< Expr > arg
Definition: ParserNode.h:495
const Expr* Parser::CardinalityExpr::get_arg ( ) const
inline

Definition at line 487 of file ParserNode.h.

References arg.

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

Implements Parser::Expr.

Definition at line 1437 of file ParserNode.cpp.

1437  {
1438  std::string str = "CARDINALITY(" + arg->to_string() + ")";
1439  return str;
1440 }
std::unique_ptr< Expr > arg
Definition: ParserNode.h:495

Member Data Documentation

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

Definition at line 495 of file ParserNode.h.

Referenced by get_arg().


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