OmniSciDB  c1a53651b2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
YearMonthTimeInterval Struct Reference

#include <heavydbTypes.h>

Public Member Functions

DEVICE YearMonthTimeInterval (int64_t init)
 
DEVICE ALWAYS_INLINE bool operator== (const YearMonthTimeInterval &other) const
 
DEVICE ALWAYS_INLINE bool operator!= (const YearMonthTimeInterval &other) const
 
DEVICE ALWAYS_INLINE Timestamp operator+ (const Timestamp &t) const
 
DEVICE ALWAYS_INLINE
YearMonthTimeInterval 
operator* (const int64_t multiplier) const
 
DEVICE ALWAYS_INLINE int64_t numStepsBetween (const Timestamp &begin, const Timestamp &end) const
 

Public Attributes

int64_t timeval
 

Detailed Description

Definition at line 543 of file heavydbTypes.h.

Constructor & Destructor Documentation

DEVICE YearMonthTimeInterval::YearMonthTimeInterval ( int64_t  init)
inline

Definition at line 546 of file heavydbTypes.h.

Referenced by operator*().

546 : timeval(init) {}
void init(LogOptions const &log_opts)
Definition: Logger.cpp:360

+ Here is the caller graph for this function:

Member Function Documentation

DEVICE ALWAYS_INLINE int64_t YearMonthTimeInterval::numStepsBetween ( const Timestamp begin,
const Timestamp end 
) const
inline

Definition at line 565 of file heavydbTypes.h.

References Timestamp::getMonth(), Timestamp::getYear(), Timestamp::time, and timeval.

566  {
567  if ((timeval > 0 && end.time < begin.time) ||
568  (timeval < 0 && end.time > begin.time)) {
569  return -1;
570  }
571 
572  int64_t ret = ((end.getYear() * 12 + end.getMonth()) -
573  (begin.getYear() * 12 + begin.getMonth())) /
574  timeval;
575  return ret;
576  }
DEVICE ALWAYS_INLINE int64_t getYear() const
Definition: heavydbTypes.h:476
int64_t time
Definition: heavydbTypes.h:341
DEVICE ALWAYS_INLINE int64_t getMonth() const
Definition: heavydbTypes.h:473

+ Here is the call graph for this function:

DEVICE ALWAYS_INLINE bool YearMonthTimeInterval::operator!= ( const YearMonthTimeInterval other) const
inline

Definition at line 552 of file heavydbTypes.h.

References operator==().

552  {
553  return !operator==(other);
554  }
DEVICE ALWAYS_INLINE bool operator==(const YearMonthTimeInterval &other) const
Definition: heavydbTypes.h:548

+ Here is the call graph for this function:

DEVICE ALWAYS_INLINE YearMonthTimeInterval YearMonthTimeInterval::operator* ( const int64_t  multiplier) const
inline

Definition at line 561 of file heavydbTypes.h.

References timeval, and YearMonthTimeInterval().

561  {
562  return YearMonthTimeInterval(timeval * multiplier);
563  }
DEVICE YearMonthTimeInterval(int64_t init)
Definition: heavydbTypes.h:546

+ Here is the call graph for this function:

DEVICE ALWAYS_INLINE Timestamp YearMonthTimeInterval::operator+ ( const Timestamp t) const
inline

Definition at line 556 of file heavydbTypes.h.

References daMONTH, DateAddHighPrecisionNullable(), Timestamp::time, Timestamp, and timeval.

556  {
558  daMONTH, timeval, t.time, 9, inline_int_null_value<int64_t>()));
559  }
int64_t time
Definition: heavydbTypes.h:341
RUNTIME_EXPORT DEVICE int64_t DateAddHighPrecisionNullable(const DateaddField field, const int64_t number, const int64_t timeval, const int32_t dim, const int64_t null_val)

+ Here is the call graph for this function:

DEVICE ALWAYS_INLINE bool YearMonthTimeInterval::operator== ( const YearMonthTimeInterval other) const
inline

Definition at line 548 of file heavydbTypes.h.

References timeval.

Referenced by operator!=().

548  {
549  return timeval == other.timeval;
550  }

+ Here is the caller graph for this function:

Member Data Documentation

int64_t YearMonthTimeInterval::timeval

Definition at line 544 of file heavydbTypes.h.

Referenced by numStepsBetween(), operator*(), operator+(), and operator==().


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