OmniSciDB  06b3bd477c
 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

Detailed Description

Definition at line 230 of file ParserNode.h.

Constructor & Destructor Documentation

Parser::TimestampLiteral::TimestampLiteral ( )

Definition at line 232 of file ParserNode.h.

References timestampval_.

232 { 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

Implements Parser::Literal.

Definition at line 171 of file ParserNode.cpp.

174  {
175  return get(timestampval_);
176 }
std::shared_ptr< Analyzer::Expr > Parser::TimestampLiteral::get ( const int64_t  timestampval)

Definition at line 178 of file ParserNode.cpp.

References Datum::bigintval, and kTIMESTAMP.

Referenced by RelAlgTranslator::translateNow().

178  {
179  Datum d;
180  d.bigintval = timestampval;
181  return makeExpr<Analyzer::Constant>(kTIMESTAMP, false, d);
182 }
int64_t bigintval
Definition: sqltypes.h:137

+ Here is the caller graph for this function:

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

Implements Parser::Literal.

Definition at line 238 of file ParserNode.h.

References timestampval_.

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

int64_t Parser::TimestampLiteral::timestampval_

Definition at line 245 of file ParserNode.h.

Referenced by TimestampLiteral(), and to_string().

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