OmniSciDB  a5dc49c757
 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 901 of file heavydbTypes.h.

Constructor & Destructor Documentation

DEVICE YearMonthTimeInterval::YearMonthTimeInterval ( int64_t  init)
inline

Definition at line 904 of file heavydbTypes.h.

Referenced by operator*().

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

+ 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 923 of file heavydbTypes.h.

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

924  {
925  if ((timeval > 0 && end.time < begin.time) ||
926  (timeval < 0 && end.time > begin.time)) {
927  return -1;
928  }
929 
930  int64_t ret = ((end.getYear() * 12 + end.getMonth()) -
931  (begin.getYear() * 12 + begin.getMonth())) /
932  timeval;
933  return ret;
934  }
DEVICE ALWAYS_INLINE int64_t getYear() const
Definition: heavydbTypes.h:834
int64_t time
Definition: heavydbTypes.h:699
DEVICE ALWAYS_INLINE int64_t getMonth() const
Definition: heavydbTypes.h:831

+ Here is the call graph for this function:

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

Definition at line 910 of file heavydbTypes.h.

References operator==().

910  {
911  return !operator==(other);
912  }
DEVICE ALWAYS_INLINE bool operator==(const YearMonthTimeInterval &other) const
Definition: heavydbTypes.h:906

+ Here is the call graph for this function:

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

Definition at line 919 of file heavydbTypes.h.

References timeval, and YearMonthTimeInterval().

919  {
920  return YearMonthTimeInterval(timeval * multiplier);
921  }
DEVICE YearMonthTimeInterval(int64_t init)
Definition: heavydbTypes.h:904

+ Here is the call graph for this function:

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

Definition at line 914 of file heavydbTypes.h.

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

914  {
916  daMONTH, timeval, t.time, 9, inline_int_null_value<int64_t>()));
917  }
int64_t time
Definition: heavydbTypes.h:699
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 906 of file heavydbTypes.h.

References timeval.

Referenced by operator!=().

906  {
907  return timeval == other.timeval;
908  }

+ Here is the caller graph for this function:

Member Data Documentation

int64_t YearMonthTimeInterval::timeval

Definition at line 902 of file heavydbTypes.h.

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


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