OmniSciDB  f632821e96
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::Exprget (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 230 of file ParserNode.h.

Constructor & Destructor Documentation

◆ TimestampLiteral()

Parser::TimestampLiteral::TimestampLiteral ( )
inlineexplicit

Definition at line 232 of file ParserNode.h.

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

Member Function Documentation

◆ analyze()

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

172  {
173  return get(timestampval_);
174 }

◆ get()

std::shared_ptr< Analyzer::Expr > Parser::TimestampLiteral::get ( const int64_t  timestampval)
static

Definition at line 176 of file ParserNode.cpp.

References Datum::bigintval, and kTIMESTAMP.

Referenced by RelAlgTranslator::translateNow().

176  {
177  Datum d;
178  d.bigintval = timestampval;
179  return makeExpr<Analyzer::Constant>(kTIMESTAMP, false, d);
180 }
int64_t bigintval
Definition: sqltypes.h:138
+ Here is the caller graph for this function:

◆ to_string()

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

Implements Parser::Literal.

Definition at line 238 of file ParserNode.h.

238  {
239  // TODO: Should we convert to a datum and use the datum toString converters to pretty
240  // print?
241  return boost::lexical_cast<std::string>(timestampval_);
242  }

Member Data Documentation

◆ timestampval_

int64_t Parser::TimestampLiteral::timestampval_
private

Definition at line 245 of file ParserNode.h.


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