|
1 /* -*- Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- */ |
|
2 /* |
|
3 * Copyright (c) 2005,2006 INRIA |
|
4 * All rights reserved. |
|
5 * |
|
6 * This program is free software; you can redistribute it and/or modify |
|
7 * it under the terms of the GNU General Public License version 2 as |
|
8 * published by the Free Software Foundation; |
|
9 * |
|
10 * This program is distributed in the hope that it will be useful, |
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 * GNU General Public License for more details. |
|
14 * |
|
15 * You should have received a copy of the GNU General Public License |
|
16 * along with this program; if not, write to the Free Software |
|
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
18 * |
|
19 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
|
20 */ |
|
21 #ifndef TIME_H |
|
22 #define TIME_H |
|
23 |
|
24 #include <stdint.h> |
|
25 |
|
26 namespace ns3 { |
|
27 |
|
28 class Time { |
|
29 public: |
|
30 Time (Time const &o); |
|
31 Time &operator = (Time const &o); |
|
32 double s (void) const; |
|
33 uint64_t us (void) const; |
|
34 bool is_destroy (void) const; |
|
35 protected: |
|
36 Time (uint64_t us); |
|
37 Time (); |
|
38 private: |
|
39 uint64_t m_us; |
|
40 bool m_is_destroy; |
|
41 }; |
|
42 |
|
43 Time operator + (Time const &lhs, uint64_t delta); |
|
44 Time operator + (Time const &lhs, double delta); |
|
45 |
|
46 |
|
47 class AbsTimeS : public Time { |
|
48 public: |
|
49 AbsTimeS (double s); |
|
50 }; |
|
51 class AbsTimeUs : public Time { |
|
52 public: |
|
53 AbsTimeUs (uint64_t us); |
|
54 }; |
|
55 class RelTimeS : public Time { |
|
56 public: |
|
57 RelTimeS (double s); |
|
58 }; |
|
59 class RelTimeUs : public Time { |
|
60 public: |
|
61 RelTimeUs (uint64_t us); |
|
62 }; |
|
63 |
|
64 class NowTime : public Time { |
|
65 public: |
|
66 NowTime (); |
|
67 }; |
|
68 |
|
69 class DestroyTime : public Time { |
|
70 public: |
|
71 DestroyTime (); |
|
72 }; |
|
73 |
|
74 }; // namespace ns3 |
|
75 |
|
76 #endif /* TIME_H */ |