source: ntrip/trunk/BNC/t_time.h@ 2122

Last change on this file since 2122 was 2122, checked in by mervart, 15 years ago

* empty log message *

File size: 852 bytes
Line 
1
2#ifndef TIME_H
3#define TIME_H
4
5#include <string>
6
7class t_time {
8 public:
9 t_time() {this->reset();}
10 t_time(int gpsw, double gpssec);
11
12 t_time& set(int gpsw, double gpssec);
13
14 unsigned int mjd() const;
15 double daysec() const;
16 unsigned int gpsw() const;
17 double gpssec() const;
18
19 bool operator!=(const t_time &time1) const;
20 double operator-(const t_time &time1) const;
21 t_time operator-(double sec) const;
22 t_time operator+(double sec) const;
23
24 std::string timestr(unsigned numdec = 3, char sep = ':') const;
25
26 private:
27 t_time& setmjd(double daysec, int mjd);
28 void reset() {_mjd = 0; _sec = 0;}
29 void civil_time (unsigned int& hour, unsigned int& min, double& sec) const;
30 static void jdgp(double tjul, double & second, long & nweek);
31
32 unsigned int _mjd;
33 double _sec;
34};
35
36#endif
37
Note: See TracBrowser for help on using the repository browser.