source: XIOS/branchs/xios-1.0/src/duration.hpp @ 910

Last change on this file since 910 was 612, checked in by rlacroix, 9 years ago

Improve CF compliance: Write the "cell_methods" metadata.

Also try to use the time units defined by the UDUnits specification.

  • Property copyright set to
    Software name : XIOS (Xml I/O Server)
    http://forge.ipsl.jussieu.fr/ioserver
    Creation date : January 2009
    Licence : CeCCIL version2
    see license file in root directory : Licence_CeCILL_V2-en.txt
    or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
    Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement)
    CNRS/IPSL (Institut Pierre Simon Laplace)
    Project Manager : Yann Meurdesoif
    yann.meurdesoif@cea.fr
File size: 1.6 KB
Line 
1#ifndef __XMLIO_CDuration__
2#define __XMLIO_CDuration__
3
4/// xios headers ///
5#include "xmlioserver_spl.hpp"
6#include "exception.hpp"
7
8namespace xios
9{
10      /// ////////////////////// Déclarations ////////////////////// ///
11      typedef long long int Time;
12      class CCalendar;
13
14      ///---------------------------------------------------------------
15      typedef struct _duration
16      {
17         public :
18
19            /// Opérateurs ///
20            struct _duration & operator=(const struct _duration& duration);
21
22            friend StdOStream & operator<<(StdOStream & out, const struct _duration& duration);
23            friend StdIStream & operator>>(StdIStream & in , struct _duration& duration);
24
25            /// Test ///
26            bool isNone(void) const;
27
28            /// Traitement ///
29            struct _duration & resolve(const CCalendar & calendar);
30            struct _duration & solveTimeStep(const CCalendar & c) ;
31            /// Autres ///
32            StdString toString(void) const;
33            StdString toStringUDUnits(void) const;
34
35         public: /* static */
36
37            static struct _duration FromString(const StdString & str);
38
39            /// Propriétés publiques ///
40            double year, month, day, hour, minute, second, timestep;
41
42      } CDuration;
43
44      ///---------------------------------------------------------------
45
46      const extern CDuration Year, Month , Week  , Day    ,
47                             Hour, Minute, Second, NoneDu, TimeStep ;
48      ///---------------------------------------------------------------
49
50} // namespace xios
51
52#endif // __XMLIO_CDuration__
Note: See TracBrowser for help on using the repository browser.