# MI - Fimex: MetNoFimex::TimeSpec Class Reference

# MetNoFimex::TimeSpec Class Reference

`#include <TimeSpec.h>`

List of all members.

## Public Member Functions

| TimeSpec (const std::string &timeSpec, const FimexTime &startTime, const FimexTime &endTime) throw (CDMException)
virtual | ~TimeSpec ()
const std::vector< FimexTime > & | getTimeSteps () const
const std::string & | getUnitString () const

## Detailed Description

This class can be used to describe a list of times in an efficient textual way.

Unless otherwise mentioned, i.e. with bounds a value v(time) describes the time at exactly that instance. All times are UTC.

- TIMESTAMP format: YYYY-MM-DD HH:MM:SS
- TIMESTAMPS: comma-separated list of values with possible ... extension, ... meaning continuation of the difference of the previous two values
- UNIT: see udunit, default: second
- VALUE: float-number
- VALUES: comma-separated list of values with possible ... extension, ... meaning continuation of the difference of the previous two values 0 is the first time in the original time-axis, x is the last time-value in the original time-axis

A TimeSpec consists of at least of timestamps or values:

- timespec := (TIMESTAMPS | VALUES[;relativeUnit=UNIT])[;unit=UNIT]

relativeUnit will reset the relative value 0 to the first value larger than t0 (original start time) with t0 = i * (v1-v0)* unit with i being a integer.

     timespec = 2000-01-01 00:00:00,2000-01-01 00:04:00,...,2010-01-01 00:00:00

All times outside the original time-axis will be discarded.

     timespec = -3,0,3,...,x,x+3;relativeUnit=hours since 2000-01-01 00:00:00;unit=hours since 2000-01-01 00:00:00;

## Constructor & Destructor Documentation

MetNoFimex::TimeSpec::TimeSpec | ( | const std::string & | timeSpec,
|  | const FimexTime & | startTime,
|  | const FimexTime & | endTime |
| ) |  |  | throw (CDMException)

Define a timeSpec

Parameters:

  | timeSpec | string representation as explained above
  | startTime | time to start in case of a relativeStart timeSpec
  | endTime | time to end in case of a relativeStart timeSpec

virtual MetNoFimex::TimeSpec::~TimeSpec | ( |  | ) | `[inline, virtual]`

## Member Function Documentation

const std::vector<FimexTime>& MetNoFimex::TimeSpec::getTimeSteps | ( |  | ) | const`[inline]`

const std::string& MetNoFimex::TimeSpec::getUnitString | ( |  | ) | const`[inline]`

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

- include/fimex/TimeSpec.h