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

#include <TimeUnit.h>

Public Member Functions

 TimeUnit () throw (CDMException)
 initialize a timeUnit with a unit string More...
 
 TimeUnit (const std::string &timeUnitString) throw (CDMException)
 
virtual ~TimeUnit ()
 
double unitTime2epochSeconds (double unitTime) const
 calculate the epochSeconds for a time in the current unit More...
 
boost::posix_time::ptime unitTime2posixTime (double unitTime) const
 calculate the ptime for a time in the current unit More...
 
double epochSeconds2unitTime (double epochSeconds) const
 calculate the time in the current unit from the epoch More...
 
FimexTime unitTime2fimexTime (double unitTime) const throw (CDMException)
 calculate the time in a calendar form More...
 
double fimexTime2unitTime (const FimexTime &fiTime) const throw (CDMException)
 calculate the time in the current unit from the calendar form More...
 
double fimexTime2unitTimeX (FimexTime fiTime) const throw (CDMException)
 same as fimexTime2unitTime but copying fiTime instead of referencing, needed for i.e. bind1st(mem_fun()) More...
 
double posixTime2unitTime (boost::posix_time::ptime poTime) const throw (CDMException)
 calculate the unitTime from a boost::posix_time More...
 

Detailed Description

TimeUnit calculates times from a time given in a unit as of CF-1.0 (e.g. 'days since 2000-01-01 00:00:00') to a unix time (i.e. 'seconds since 1970-01-01 00:00:00') or a time struct MetNoFimex::FimexTime

All times are assumed to be UTC, and we use the Gregorian Calendar (not 100% true for times before 1600AD, depending on implementation)

Constructor & Destructor Documentation

MetNoFimex::TimeUnit::TimeUnit ( )
throw (CDMException
)

initialize a timeUnit with a unit string

MetNoFimex::TimeUnit::TimeUnit ( const std::string timeUnitString)
throw (CDMException
)
virtual MetNoFimex::TimeUnit::~TimeUnit ( )
virtual

Member Function Documentation

double MetNoFimex::TimeUnit::epochSeconds2unitTime ( double  epochSeconds) const

calculate the time in the current unit from the epoch

double MetNoFimex::TimeUnit::fimexTime2unitTime ( const FimexTime fiTime) const
throw (CDMException
)

calculate the time in the current unit from the calendar form

double MetNoFimex::TimeUnit::fimexTime2unitTimeX ( FimexTime  fiTime) const
throw (CDMException
)
inline

same as fimexTime2unitTime but copying fiTime instead of referencing, needed for i.e. bind1st(mem_fun())

double MetNoFimex::TimeUnit::posixTime2unitTime ( boost::posix_time::ptime  poTime) const
throw (CDMException
)

calculate the unitTime from a boost::posix_time

double MetNoFimex::TimeUnit::unitTime2epochSeconds ( double  unitTime) const

calculate the epochSeconds for a time in the current unit

FimexTime MetNoFimex::TimeUnit::unitTime2fimexTime ( double  unitTime) const
throw (CDMException
)

calculate the time in a calendar form

boost::posix_time::ptime MetNoFimex::TimeUnit::unitTime2posixTime ( double  unitTime) const

calculate the ptime for a time in the current unit


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