MI - Fimex
Public Types | Public Member Functions | List of all members
MetNoFimex::FimexTime Class Reference

#include <fimex/TimeUnit.h>

Public Types

enum  special_values { min_date_time, max_date_time }
 

Public Member Functions

 FimexTime ()
 
 FimexTime (unsigned short year, char month, char mday, char hour=0, char minute=0, char second=0, unsigned short msecond=0)
 
 FimexTime (special_values val)
 
bool parseISO8601 (const std::string &isoString)
 
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 More...
 
unsigned short getYear () const
 year (2008 as of writing) More...
 
void setYear (unsigned short year)
 
char getMonth () const
 month (1-12) More...
 
void setMonth (char month)
 
char getMDay () const
 day of month (1-31) More...
 
void setMDay (char mday)
 
char getHour () const
 hour (0-23) More...
 
void setHour (char hour)
 
char getMinute () const
 minute (0-59) More...
 
void setMinute (char minute)
 
char getSecond () const
 second (0-59) More...
 
void setSecond (char second)
 
unsigned short getMSecond () const
 millisecond More...
 
void setMSecond (unsigned short msecond)
 
boost::posix_time::ptime asPosixTime () const
 
bool operator== (const FimexTime &rhs) const
 compare two fimexTimes More...
 
bool operator!= (const FimexTime &rhs) const
 compare two fimexTimes More...
 
bool operator> (const FimexTime &rhs) const
 compare two fimexTimes More...
 
bool operator< (const FimexTime &rhs) const
 compare two fimexTimes More...
 
bool operator>= (const FimexTime &rhs) const
 compare two fimexTimes More...
 
bool operator<= (const FimexTime &rhs) const
 compare two fimexTimes More...
 

Detailed Description

time representation and some overloaded operators

Warning
: the implementor needs to make sure, that all values are given correctly, i.e. seconds between 0 and 59

Member Enumeration Documentation

Enumerator
min_date_time 
max_date_time 

Constructor & Destructor Documentation

MetNoFimex::FimexTime::FimexTime ( )
inline

References parseISO8601(), and setTime().

MetNoFimex::FimexTime::FimexTime ( unsigned short  year,
char  month,
char  mday,
char  hour = 0,
char  minute = 0,
char  second = 0,
unsigned short  msecond = 0 
)
MetNoFimex::FimexTime::FimexTime ( special_values  val)

Member Function Documentation

boost::posix_time::ptime MetNoFimex::FimexTime::asPosixTime ( ) const

Referenced by setMSecond().

char MetNoFimex::FimexTime::getHour ( ) const
inline

hour (0-23)

char MetNoFimex::FimexTime::getMDay ( ) const
inline

day of month (1-31)

char MetNoFimex::FimexTime::getMinute ( ) const
inline

minute (0-59)

char MetNoFimex::FimexTime::getMonth ( ) const
inline

month (1-12)

unsigned short MetNoFimex::FimexTime::getMSecond ( ) const
inline

millisecond

char MetNoFimex::FimexTime::getSecond ( ) const
inline

second (0-59)

unsigned short MetNoFimex::FimexTime::getYear ( ) const
inline

year (2008 as of writing)

bool MetNoFimex::FimexTime::operator!= ( const FimexTime rhs) const
inline

compare two fimexTimes

bool MetNoFimex::FimexTime::operator< ( const FimexTime rhs) const
inline

compare two fimexTimes

bool MetNoFimex::FimexTime::operator<= ( const FimexTime rhs) const
inline

compare two fimexTimes

References MetNoFimex::operator<<(), and MetNoFimex::string2FimexTime().

bool MetNoFimex::FimexTime::operator== ( const FimexTime rhs) const

compare two fimexTimes

Referenced by setMSecond().

bool MetNoFimex::FimexTime::operator> ( const FimexTime rhs) const
inline

compare two fimexTimes

bool MetNoFimex::FimexTime::operator>= ( const FimexTime rhs) const
inline

compare two fimexTimes

bool MetNoFimex::FimexTime::parseISO8601 ( const std::string isoString)

parse and set the time in ISO8601 formats (not all), e.g. YYYY-MM-DD, HH:MM:SS, YYYY-MM-DD HH:MM:SS, YYYY-MM-DDTHH:MM:SS (and without seconds)

Returns
true, if time/date has been set, false otherwise

Referenced by FimexTime().

void MetNoFimex::FimexTime::setHour ( char  hour)
inline
void MetNoFimex::FimexTime::setMDay ( char  mday)
inline
void MetNoFimex::FimexTime::setMinute ( char  minute)
inline
void MetNoFimex::FimexTime::setMonth ( char  month)
inline
void MetNoFimex::FimexTime::setMSecond ( unsigned short  msecond)
inline

References asPosixTime(), and operator==().

void MetNoFimex::FimexTime::setSecond ( char  second)
inline
void MetNoFimex::FimexTime::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

Referenced by FimexTime().

void MetNoFimex::FimexTime::setYear ( unsigned short  year)
inline

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