Enables comparison with infinite timestamps.

Bug: webrtc:8415
Change-Id: Ia96c7a537d994c281d8b24e648dbb2e17de3ed4a
Reviewed-on: https://webrtc-review.googlesource.com/78182
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23383}
This commit is contained in:
Sebastian Jansson
2018-05-24 12:32:05 +02:00
committed by Commit Bot
parent a927ed576a
commit ec2eb2218f
2 changed files with 14 additions and 4 deletions

View File

@ -78,10 +78,18 @@ class Timestamp {
bool operator!=(const Timestamp& other) const {
return microseconds_ != other.microseconds_;
}
bool operator<=(const Timestamp& other) const { return us() <= other.us(); }
bool operator>=(const Timestamp& other) const { return us() >= other.us(); }
bool operator>(const Timestamp& other) const { return us() > other.us(); }
bool operator<(const Timestamp& other) const { return us() < other.us(); }
bool operator<=(const Timestamp& other) const {
return microseconds_ <= other.microseconds_;
}
bool operator>=(const Timestamp& other) const {
return microseconds_ >= other.microseconds_;
}
bool operator>(const Timestamp& other) const {
return microseconds_ > other.microseconds_;
}
bool operator<(const Timestamp& other) const {
return microseconds_ < other.microseconds_;
}
private:
explicit Timestamp(int64_t us) : microseconds_(us) {}