17 #include <pia/common/common_TimeSpan.h> 51 explicit Time(u64 tick)
109 m_Tick += span.m_TickSpan;
123 m_Tick -= span.m_TickSpan;
138 time.m_Tick = m_Tick + span.m_TickSpan;
153 time.m_Tick = m_Tick - span.m_TickSpan;
168 span.m_TickSpan = m_Tick - rhs.m_Tick;
182 return (m_Tick == rhs.m_Tick);
195 return (m_Tick != rhs.m_Tick);
208 return (m_Tick < rhs.m_Tick);
221 return (m_Tick <= rhs.m_Tick);
234 return (m_Tick > rhs.m_Tick);
247 return (m_Tick >= rhs.m_Tick);
259 static Time ConvertTimeoutToDeadline(
const TimeSpan& timeout)
273 u64 GetTick(
void)
const 287 void SetTick(u64 tick)
298 void Trace(u64 flag)
const;
300 static const Time c_Max;
301 static const Time c_Min;
304 static Time Create(u64 tick);
Class that represents time.
Definition: common_Time.h:39
Time operator-(const TimeSpan &span) const
Calculates a Time object holding the amount of time subtracted from this instance.
Definition: common_Time.h:150
void Trace(u64 flag) const
Prints information useful for debugging.
bool operator!=(const Time &rhs) const
Equality operator. Determines whether two Time objects differ.
Definition: common_Time.h:193
Time(const Time &rhs)
Copy constructor.
Definition: common_Time.h:61
bool operator>(const Time &rhs) const
Comparison operator. Returns true if this instance is later.
Definition: common_Time.h:232
TimeSpan operator-(const Time &rhs) const
Calculates a time delta.
Definition: common_Time.h:165
Time & operator=(const Time &rhs)
Assignment operator.
Definition: common_Time.h:93
bool operator<(const Time &rhs) const
Comparison operator. Returns true if this instance is earlier.
Definition: common_Time.h:206
bool operator==(const Time &rhs) const
Equality operator. Determines whether two Time objects are equal.
Definition: common_Time.h:180
Class for representing time spans. This class can perform type conversions with numeric values in mil...
Definition: common_TimeSpan.h:41
Time operator+(const TimeSpan &span) const
Calculates a Time object holding the amount of time added to this instance.
Definition: common_Time.h:135
void SetNow()
Makes this object represent the current time.
Time()
Instantiates the object with default parameters (default constructor).
Definition: common_Time.h:45
Time & operator-=(const TimeSpan &span)
Subtracts time from this instance.
Definition: common_Time.h:121
bool operator>=(const Time &rhs) const
Comparison operator. Returns true if this instance is later or equal.
Definition: common_Time.h:245
bool operator<=(const Time &rhs) const
Comparison operator. Returns true if this instance is earlier or equal.
Definition: common_Time.h:219
This is the common base class used inside the Pia library.
Definition: common_RootObject.h:40
static Time GetTime()
Gets a Time instance representing the current time.
Definition: common_Time.h:78
Time & operator+=(const TimeSpan &span)
Adds time to this instance's time.
Definition: common_Time.h:107