All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
time.h
Go to the documentation of this file.
1 #ifndef TIME_H_INCLUDED_
2 #define TIME_H_INCLUDED_
3 
4 #include <iostream>
5 
6 namespace risc {
7 
8 namespace sg {
9 
14 class Time {
15 public:
16 
21  Time();
22 
28  Time(unsigned long long time_units, int delta_count);
29 
35  Time(unsigned long long time_units, int delta_count, bool infinite);
36 
41  Time(bool infinite);
42 
44  unsigned long long time_units_;
45 
46  bool operator<(const Time &ohs);
47  bool operator>(const Time &ohs);
48 
49  bool operator<=(const Time &ohs);
50  bool operator>=(const Time &ohs);
51 
52  bool operator==(const Time &ohs);
53  bool operator!=(const Time &ohs);
54 
55  Time operator+(const Time &ohs);
56  Time& operator+=(const Time &ohs);
57 
61  bool infinite_;
62 
68  bool one_delta_cycle_ahead(const Time &ohs);
69 
70 
71 
72  static long long convert_si_magnitude(std::string magnitude);
73 
74 };
75 
76 std::ostream& operator<<(std::ostream& os, const risc::sg::Time& time);
77 
78 }; // end of namesapce sg
79 
80 }; // end of namespace risc
81 
82 #endif /* TIME_H_INCLUDED_ */
83 
84 /* ex: set softtabstop=2 tabstop=2 shiftwidth=2 expandtab: */
bool infinite_
This flag is set to describe an infinite amount of time.
Definition: time.h:61
bool operator>=(const Time &ohs)
Definition: time.cpp:82
Time()
This constructor initializes the time values with (0,0)
Definition: time.cpp:5
static long long convert_si_magnitude(std::string magnitude)
Definition: time.cpp:136
bool operator==(const Time &ohs)
Definition: time.cpp:88
unsigned long long time_units_
Definition: time.h:44
bool one_delta_cycle_ahead(const Time &ohs)
The function checks if the difference between this and the given time stamp is exactly one delta cycl...
Definition: time.cpp:118
bool operator>(const Time &ohs)
Definition: time.cpp:53
int delta_count_
Definition: time.h:43
This class represents timing in discrete event simulation.
Definition: time.h:14
bool operator<(const Time &ohs)
Definition: time.cpp:30
Time & operator+=(const Time &ohs)
Definition: time.cpp:111
Time operator+(const Time &ohs)
Definition: time.cpp:101
std::ostream & operator<<(std::ostream &os, const risc::sg::Time &time)
Definition: time.cpp:125
bool operator!=(const Time &ohs)
Definition: time.cpp:95
bool operator<=(const Time &ohs)
Definition: time.cpp:76