OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4TimeMilliseconds.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  C4TimeMilliseconds
 

Functions

bool operator== (const C4TimeMilliseconds &lhs, const C4TimeMilliseconds &rhs)
 
bool operator< (const C4TimeMilliseconds &lhs, const C4TimeMilliseconds &rhs)
 
bool operator!= (const C4TimeMilliseconds &lhs, const C4TimeMilliseconds &rhs)
 
bool operator> (const C4TimeMilliseconds &lhs, const C4TimeMilliseconds &rhs)
 
bool operator<= (const C4TimeMilliseconds &lhs, const C4TimeMilliseconds &rhs)
 
bool operator>= (const C4TimeMilliseconds &lhs, const C4TimeMilliseconds &rhs)
 
int32_t operator- (const C4TimeMilliseconds &lhs, const C4TimeMilliseconds &rhs)
 
C4TimeMilliseconds operator+ (C4TimeMilliseconds lhs, const uint32_t &rhs)
 
C4TimeMilliseconds operator- (C4TimeMilliseconds lhs, const uint32_t &rhs)
 

Function Documentation

bool operator!= ( const C4TimeMilliseconds lhs,
const C4TimeMilliseconds rhs 
)
inline

Definition at line 80 of file C4TimeMilliseconds.h.

80 { return !(lhs == rhs); }
C4TimeMilliseconds operator+ ( C4TimeMilliseconds  lhs,
const uint32_t &  rhs 
)
inline

Definition at line 87 of file C4TimeMilliseconds.h.

87 { lhs += rhs; return lhs; }
int32_t operator- ( const C4TimeMilliseconds lhs,
const C4TimeMilliseconds rhs 
)

Definition at line 90 of file C4TimeMilliseconds.cpp.

References C4TimeMilliseconds::NoInfinity.

91 {
92  // if infinity is set, nothing else than infinity matters (infinity + 100 == infinity)
93  if (lhs.inf != C4TimeMilliseconds::NoInfinity ||
95  {
96  int infinityTo = lhs.inf - rhs.inf;
97 
98  if (infinityTo < 0) return std::numeric_limits<int32_t>::min();
99  if (infinityTo > 0) return std::numeric_limits<int32_t>::max();
100  return 0;
101  }
102  // otherwise, as usual
103  return int32_t(lhs.time - rhs.time);
104 }
C4TimeMilliseconds operator- ( C4TimeMilliseconds  lhs,
const uint32_t &  rhs 
)
inline

Definition at line 88 of file C4TimeMilliseconds.h.

88 { lhs -= rhs; return lhs; }
bool operator< ( const C4TimeMilliseconds lhs,
const C4TimeMilliseconds rhs 
)

Definition at line 80 of file C4TimeMilliseconds.cpp.

References C4TimeMilliseconds::NoInfinity.

81 {
82  if (lhs.inf != C4TimeMilliseconds::NoInfinity ||
84  {
85  return lhs.inf < rhs.inf;
86  }
87  return lhs.time < rhs.time;
88 }
bool operator<= ( const C4TimeMilliseconds lhs,
const C4TimeMilliseconds rhs 
)
inline

Definition at line 82 of file C4TimeMilliseconds.h.

82 { return !(lhs > rhs); }
bool operator== ( const C4TimeMilliseconds lhs,
const C4TimeMilliseconds rhs 
)

Definition at line 74 of file C4TimeMilliseconds.cpp.

75 {
76  return lhs.inf == rhs.inf &&
77  lhs.time == rhs.time;
78 }
bool operator> ( const C4TimeMilliseconds lhs,
const C4TimeMilliseconds rhs 
)
inline

Definition at line 81 of file C4TimeMilliseconds.h.

81 { return rhs < lhs; }
bool operator>= ( const C4TimeMilliseconds lhs,
const C4TimeMilliseconds rhs 
)
inline

Definition at line 83 of file C4TimeMilliseconds.h.

83 { return !(lhs < rhs); }