src: refactoring TimePoint
* removed typedef utility::TimePoint and replaced all its usages by using the class TimePoint instead.
This commit is contained in:
@@ -11,6 +11,8 @@ public:
|
||||
//TimePoint(time_t t);
|
||||
TimePoint(std::string s);
|
||||
|
||||
std::string toString() const;
|
||||
|
||||
inline bool operator==(const TimePoint& rhs){ return m_time == rhs.m_time; }
|
||||
inline bool operator!=(const TimePoint& rhs){ return m_time != rhs.m_time; }
|
||||
inline bool operator<(const TimePoint& rhs){ return m_time < rhs.m_time; }
|
||||
@@ -18,6 +20,8 @@ public:
|
||||
inline bool operator<=(const TimePoint& rhs){ return m_time <= rhs.m_time; }
|
||||
inline bool operator>=(const TimePoint& rhs){ return m_time >= rhs.m_time; }
|
||||
|
||||
inline float operator-(const TimePoint& rhs){ return (m_time - rhs.m_time).total_milliseconds() / 1000.0f; }
|
||||
|
||||
private:
|
||||
boost::posix_time::ptime m_time;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user