OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Parser::TimestampLiteral Class Reference

#include <ParserNode.h>

+ Inheritance diagram for Parser::TimestampLiteral:
+ Collaboration diagram for Parser::TimestampLiteral:

Public Member Functions

 TimestampLiteral ()
 
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 ()
 

Static Public Member Functions

static std::shared_ptr
< Analyzer::Expr
get (const int64_t)
 

Private Attributes

int64_t timestampval_
 

Additional Inherited Members

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

Detailed Description

Definition at line 247 of file ParserNode.h.

Constructor & Destructor Documentation

Parser::TimestampLiteral::TimestampLiteral ( )
inlineexplicit

Definition at line 249 of file ParserNode.h.

References timestampval_.

249 { time(reinterpret_cast<time_t*>(&timestampval_)); }

Member Function Documentation

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

Implements Parser::Literal.

Definition at line 166 of file ParserNode.cpp.

169  {
170  return get(timestampval_);
171 }
std::shared_ptr< Analyzer::Expr > Parser::TimestampLiteral::get ( const int64_t  timestampval)
static

Definition at line 173 of file ParserNode.cpp.

References Datum::bigintval, and kTIMESTAMP.

Referenced by RelAlgTranslator::translateNow(), and anonymous_namespace{CalciteAdapter.cpp}::CalciteAdapter::translateNow().

173  {
174  Datum d;
175  d.bigintval = timestampval;
176  return makeExpr<Analyzer::Constant>(kTIMESTAMP, false, d);
177 }
int64_t bigintval
Definition: sqltypes.h:129

+ Here is the caller graph for this function:

std::string Parser::TimestampLiteral::to_string ( ) const
inlineoverridevirtual

Implements Parser::Literal.

Definition at line 255 of file ParserNode.h.

References timestampval_.

255  {
256  // TODO: Should we convert to a datum and use the datum toString converters to pretty
257  // print?
258  return boost::lexical_cast<std::string>(timestampval_);
259  }

Member Data Documentation

int64_t Parser::TimestampLiteral::timestampval_
private

Definition at line 262 of file ParserNode.h.

Referenced by TimestampLiteral(), and to_string().


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