Rcpp Version 0.12.12
Rcpp::Datetime Class Reference

#include <Datetime.h>

Public Member Functions

 Datetime ()
 
 Datetime (SEXP s)
 
 Datetime (const double &dt)
 
 Datetime (const std::string &s, const std::string &fmt="%Y-%m-%d %H:%M:%OS")
 
double getFractionalTimestamp (void) const
 
int getMicroSeconds () const
 
int getSeconds () const
 
int getMinutes () const
 
int getHours () const
 
int getDay () const
 
int getMonth () const
 
int getYear () const
 
int getWeekday () const
 
int getYearday () const
 
int is_na () const
 
 operator double () const
 
std::string format (const char *fmt="%Y-%m-%d %H:%M:%S") const
 

Private Member Functions

void update_tm ()
 

Static Private Member Functions

static unsigned int baseYear ()
 

Private Attributes

double m_dt
 
struct tm m_tm
 
unsigned int m_us
 

Friends

Datetime operator+ (const Datetime &dt, double offset)
 
Datetime operator+ (const Datetime &dt, int offset)
 
double operator- (const Datetime &dt1, const Datetime &dt2)
 
bool operator< (const Datetime &dt1, const Datetime &dt2)
 
bool operator> (const Datetime &dt1, const Datetime &dt2)
 
bool operator== (const Datetime &dt1, const Datetime &dt2)
 
bool operator>= (const Datetime &dt1, const Datetime &dt2)
 
bool operator<= (const Datetime &dt1, const Datetime &dt2)
 
bool operator!= (const Datetime &dt1, const Datetime &dt2)
 
std::ostream & operator<< (std::ostream &s, const Datetime d)
 

Detailed Description

Definition at line 33 of file Datetime.h.

Constructor & Destructor Documentation

Rcpp::Datetime::Datetime ( )
inline

Definition at line 35 of file Datetime.h.

References m_dt, and update_tm().

Referenced by Datetime().

Here is the call graph for this function:

Rcpp::Datetime::Datetime ( SEXP  s)
inline

Definition at line 25 of file Datetime.h.

References m_dt, and update_tm().

Here is the call graph for this function:

Rcpp::Datetime::Datetime ( const double &  dt)
inline

Definition at line 42 of file Datetime.h.

References Datetime(), R::dt(), m_dt, and update_tm().

Here is the call graph for this function:

Rcpp::Datetime::Datetime ( const std::string &  s,
const std::string &  fmt = "%Y-%m-%d %H:%M:%OS" 
)
inline

Definition at line 30 of file Datetime.h.

References m_dt, and update_tm().

Here is the call graph for this function:

Member Function Documentation

static unsigned int Rcpp::Datetime::baseYear ( )
inlinestaticprivate

Definition at line 116 of file Datetime.h.

References R::dt().

Here is the call graph for this function:

std::string Rcpp::Datetime::format ( const char *  fmt = "%Y-%m-%d %H:%M:%S") const
inline

Definition at line 75 of file Datetime.h.

References m_dt, m_us, operator<<, and Rcpp::tm.

Referenced by Rcpp::operator<<().

int Rcpp::Datetime::getDay ( ) const
inline

Definition at line 54 of file Datetime.h.

References m_tm.

double Rcpp::Datetime::getFractionalTimestamp ( void  ) const
inline

Definition at line 48 of file Datetime.h.

References m_dt.

int Rcpp::Datetime::getHours ( ) const
inline

Definition at line 53 of file Datetime.h.

References m_tm.

int Rcpp::Datetime::getMicroSeconds ( ) const
inline

Definition at line 50 of file Datetime.h.

References m_us.

int Rcpp::Datetime::getMinutes ( ) const
inline

Definition at line 52 of file Datetime.h.

References m_tm.

int Rcpp::Datetime::getMonth ( ) const
inline

Definition at line 55 of file Datetime.h.

References m_tm.

int Rcpp::Datetime::getSeconds ( ) const
inline

Definition at line 51 of file Datetime.h.

References m_tm.

int Rcpp::Datetime::getWeekday ( ) const
inline

Definition at line 57 of file Datetime.h.

References m_tm.

int Rcpp::Datetime::getYear ( ) const
inline

Definition at line 56 of file Datetime.h.

References m_tm.

int Rcpp::Datetime::getYearday ( ) const
inline

Definition at line 58 of file Datetime.h.

References R::dt(), m_tm, operator!=, operator+, operator-, operator<, operator<=, operator==, operator>, and operator>=.

Here is the call graph for this function:

int Rcpp::Datetime::is_na ( ) const
inline

Definition at line 71 of file Datetime.h.

References Rcpp::traits::is_na< REALSXP >(), and m_dt.

Here is the call graph for this function:

Rcpp::Datetime::operator double ( ) const
inline

Definition at line 73 of file Datetime.h.

References m_dt.

void Rcpp::Datetime::update_tm ( )
inlineprivate

Definition at line 100 of file Datetime.h.

References R::dt(), Rcpp::gmtime_(), and m_tm.

Referenced by Datetime().

Here is the call graph for this function:

Friends And Related Function Documentation

bool operator!= ( const Datetime dt1,
const Datetime dt2 
)
friend

Definition at line 164 of file Datetime.h.

Referenced by getYearday().

Datetime operator+ ( const Datetime dt,
double  offset 
)
friend

Definition at line 138 of file Datetime.h.

Referenced by getYearday().

Datetime operator+ ( const Datetime dt,
int  offset 
)
friend

Definition at line 148 of file Datetime.h.

double operator- ( const Datetime dt1,
const Datetime dt2 
)
friend

Definition at line 158 of file Datetime.h.

Referenced by getYearday().

bool operator< ( const Datetime dt1,
const Datetime dt2 
)
friend

Definition at line 159 of file Datetime.h.

Referenced by getYearday().

std::ostream& operator<< ( std::ostream &  s,
const Datetime  d 
)
friend

Definition at line 166 of file Datetime.h.

Referenced by format().

bool operator<= ( const Datetime dt1,
const Datetime dt2 
)
friend

Definition at line 163 of file Datetime.h.

Referenced by getYearday().

bool operator== ( const Datetime dt1,
const Datetime dt2 
)
friend

Definition at line 161 of file Datetime.h.

Referenced by getYearday().

bool operator> ( const Datetime dt1,
const Datetime dt2 
)
friend

Definition at line 160 of file Datetime.h.

Referenced by getYearday().

bool operator>= ( const Datetime dt1,
const Datetime dt2 
)
friend

Definition at line 162 of file Datetime.h.

Referenced by getYearday().

Member Data Documentation

struct tm Rcpp::Datetime::m_tm
private
unsigned int Rcpp::Datetime::m_us
private

Definition at line 97 of file Datetime.h.

Referenced by format(), getMicroSeconds(), and Rcpp::operator+().


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