source: XMLIO_V2/dev/dev_rv/src/XMLIO/duration.hpp @ 118

Last change on this file since 118 was 118, checked in by hozdoba, 14 years ago

Réorganisation du code gérant le calendrier.

File size: 1.1 KB
Line 
1#ifndef __XMLIO_DURATION__
2#define __XMLIO_DURATION__
3
4namespace XMLIOSERVER
5{
6   class AbstractCalendar;
7
8   typedef long long int Time;
9
10   typedef struct _duration
11   {
12      friend std::ostream& operator<<(std::ostream& out, const struct _duration& d)
13      {
14         out << d.year  << "y. " << d.month  << "mo. "   <<  d.day   << "d. "
15             << d.hour  << "h. " << d.minute << "min. " << d.second << "sec. ";
16         return (out);
17      }
18
19      struct _duration& resolve(const AbstractCalendar&);
20
21      double year, month, day, hour, minute, second;
22
23   } Duration;
24
25   // Les principales durées constantes : année, mois, jour, ...
26   static const Duration Year   = {1.0, 0.0, 0.0, 0.0, 0.0, 0.0},
27                         Month  = {0.0, 1.0, 0.0, 0.0, 0.0, 0.0},
28                         Day    = {0.0, 0.0, 1.0, 0.0, 0.0, 0.0},
29                         Hour   = {0.0, 0.0, 0.0, 1.0, 0.0, 0.0},
30                         Minute = {0.0, 0.0, 0.0, 0.0, 1.0, 0.0},
31                         Second = {0.0, 0.0, 0.0, 0.0, 0.0, 1.0};
32
33} // namespace XMLIOSERVER
34
35#endif // __XMLIO_DURATION__
Note: See TracBrowser for help on using the repository browser.