27 #include "boost/shared_ptr.hpp" 31 #include <boost/date_time/posix_time/posix_time_types.hpp> 60 unsigned short msecond;
68 FimexTime(
unsigned short year,
char month,
char mday,
char hour = 0,
char minute = 0,
char second = 0,
unsigned short msecond = 0);
78 void setTime(
unsigned short year,
char month,
char mday,
char hour = 0,
char minute = 0,
char second = 0,
unsigned short msecond = 0);
80 unsigned short getYear()
const {
return year;}
81 void setYear(
unsigned short year) {this->year = year;}
84 void setMonth(
char month) {this->month = month;}
87 void setMDay(
char mday) {this->mday = mday;}
90 void setHour(
char hour) {this->hour = hour;}
93 void setMinute(
char minute) {this->minute = minute;}
96 void setSecond(
char second) {this->second = second;}
99 void setMSecond(
unsigned short msecond) {this->msecond = msecond;}
118 long long toLong()
const {
return year*10000000000000LL + month*100000000000LL + mday*1000000000LL + hour*10000000LL + minute*100000 + second*1000 + msecond; }
141 boost::shared_ptr<void> pUnit;
150 double unitTime2epochSeconds(
double unitTime)
const;
152 boost::posix_time::ptime unitTime2posixTime(
double unitTime)
const;
154 double epochSeconds2unitTime(
double epochSeconds)
const;
162 double posixTime2unitTime(boost::posix_time::ptime poTime)
const throw(
CDMException);
Definition: TimeUnit.h:64
basic_string< char > string
char getSecond() const
second (0-59)
Definition: TimeUnit.h:95
char getHour() const
hour (0-23)
Definition: TimeUnit.h:89
bool operator==(const FimexTime &rhs) const
compare two fimexTimes
char getMonth() const
month (1-12)
Definition: TimeUnit.h:83
void setYear(unsigned short year)
Definition: TimeUnit.h:81
basic_ostream< char > ostream
Definition: CDMException.h:36
void setTime(unsigned short year, char month, char mday, char hour=0, char minute=0, char second=0, unsigned short msecond=0)
set all the time-parameters at once
void setMDay(char mday)
Definition: TimeUnit.h:87
void setMonth(char month)
Definition: TimeUnit.h:84
Definition: C_CDMReader.h:35
bool operator>=(const FimexTime &rhs) const
compare two fimexTimes
Definition: TimeUnit.h:112
void setSecond(char second)
Definition: TimeUnit.h:96
Definition: TimeUnit.h:138
unsigned short getMSecond() const
millisecond
Definition: TimeUnit.h:98
void setHour(char hour)
Definition: TimeUnit.h:90
boost::posix_time::ptime asPosixTime() const
std::ostream & operator<<(std::ostream &out, CoordinateAxis ca)
bool operator<=(const FimexTime &rhs) const
compare two fimexTimes
Definition: TimeUnit.h:114
FimexTime()
Definition: TimeUnit.h:67
void setMSecond(unsigned short msecond)
Definition: TimeUnit.h:99
char getMDay() const
day of month (1-31)
Definition: TimeUnit.h:86
void setMinute(char minute)
Definition: TimeUnit.h:93
unsigned short getYear() const
year (2008 as of writing)
Definition: TimeUnit.h:80
bool operator<(const FimexTime &rhs) const
compare two fimexTimes
Definition: TimeUnit.h:110
double fimexTime2unitTimeX(FimexTime fiTime) const
same as fimexTime2unitTime but copying fiTime instead of referencing, needed for i.e. bind1st(mem_fun())
Definition: TimeUnit.h:160
bool operator>(const FimexTime &rhs) const
compare two fimexTimes
Definition: TimeUnit.h:108
Definition: TimeUnit.h:65
bool parseISO8601(const std::string &isoString)
char getMinute() const
minute (0-59)
Definition: TimeUnit.h:92
FimexTime string2FimexTime(const std::string &str)
bool operator!=(const FimexTime &rhs) const
compare two fimexTimes
Definition: TimeUnit.h:106
Definition: TimeUnit.h:45
special_values
Definition: TimeUnit.h:63