1 #ifndef PROTON_TIMESTAMP_HPP
2 #define PROTON_TIMESTAMP_HPP
23 #include "./duration.hpp"
25 #include <proton/type_compat.h>
32 class timestamp :
private internal::comparable<timestamp> {
55 inline bool operator==(timestamp x, timestamp y) {
return x.milliseconds() == y.milliseconds(); }
56 inline bool operator<(timestamp x, timestamp y) {
return x.milliseconds() < y.milliseconds(); }
58 inline timestamp operator+(timestamp ts, duration d) {
return timestamp(ts.milliseconds() + d.milliseconds()); }
59 inline duration operator-(timestamp t0, timestamp t1) {
return duration(t0.milliseconds() - t1.milliseconds()); }
60 inline timestamp operator+(duration d, timestamp ts) {
return ts + d; }
64 PN_CPP_EXTERN std::ostream&
operator<<(std::ostream&, timestamp);
68 #endif // PROTON_TIMESTAMP_HPP