src: refactoring TimePoint

* removed typedef utility::TimePoint and replaced all its usages by using the class TimePoint instead.
This commit is contained in:
malte_langkabel
2015-11-03 16:48:55 +01:00
parent 7d03166282
commit 78259c7123
8 changed files with 28 additions and 20 deletions
+4
View File
@@ -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;
};