Added compare methods for TickInterval class.
This is useful to be able to sort them using the STL algorithm library. BUG= TEST= Review URL: http://webrtc-codereview.appspot.com/173002 git-svn-id: http://webrtc.googlecode.com/svn/trunk@639 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -76,6 +76,11 @@ public:
|
|||||||
const TickInterval& rhs);
|
const TickInterval& rhs);
|
||||||
TickInterval& operator+=(const TickInterval& rhs);
|
TickInterval& operator+=(const TickInterval& rhs);
|
||||||
|
|
||||||
|
friend bool operator>(const TickInterval& lhs, const TickInterval& rhs);
|
||||||
|
friend bool operator<=(const TickInterval& lhs, const TickInterval& rhs);
|
||||||
|
friend bool operator<(const TickInterval& lhs, const TickInterval& rhs);
|
||||||
|
friend bool operator>=(const TickInterval& lhs, const TickInterval& rhs);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TickInterval(WebRtc_Word64 interval);
|
TickInterval(WebRtc_Word64 interval);
|
||||||
|
|
||||||
@@ -107,6 +112,22 @@ inline TickTime operator+(const TickTime lhs, const WebRtc_Word64 ticks)
|
|||||||
time._ticks += ticks;
|
time._ticks += ticks;
|
||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
|
inline bool operator>(const TickInterval& lhs, const TickInterval& rhs)
|
||||||
|
{
|
||||||
|
return lhs._interval > rhs._interval;
|
||||||
|
}
|
||||||
|
inline bool operator<=(const TickInterval& lhs, const TickInterval& rhs)
|
||||||
|
{
|
||||||
|
return lhs._interval <= rhs._interval;
|
||||||
|
}
|
||||||
|
inline bool operator<(const TickInterval& lhs, const TickInterval& rhs)
|
||||||
|
{
|
||||||
|
return lhs._interval <= rhs._interval;
|
||||||
|
}
|
||||||
|
inline bool operator>=(const TickInterval& lhs, const TickInterval& rhs)
|
||||||
|
{
|
||||||
|
return lhs._interval >= rhs._interval;
|
||||||
|
}
|
||||||
|
|
||||||
inline TickTime TickTime::Now()
|
inline TickTime TickTime::Now()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user