worked on wifi-scanner for linux
new time-grouping for vap grouper adjusted test-cases minor changes/fixes/improvements
This commit is contained in:
@@ -21,6 +21,7 @@ public:
|
||||
/** empty ctor */
|
||||
explicit Timestamp() : _ms(0) {;}
|
||||
|
||||
|
||||
/** get timestamp from the given value which represents milliesconds */
|
||||
static inline Timestamp fromMS(const int64_t ms) {return Timestamp(ms);}
|
||||
|
||||
@@ -75,11 +76,14 @@ public:
|
||||
|
||||
|
||||
Timestamp operator - (const Timestamp& o) const {return Timestamp(_ms - o._ms);}
|
||||
Timestamp& operator -= (const Timestamp& o) {_ms += o._ms; return *this;}
|
||||
|
||||
Timestamp operator + (const Timestamp& o) const {return Timestamp(_ms + o._ms);}
|
||||
Timestamp& operator += (const Timestamp& o) {_ms += o._ms; return *this;}
|
||||
|
||||
Timestamp operator * (const float val) const {return Timestamp(_ms * val);}
|
||||
template <typename T> Timestamp operator * (const T val) const {return Timestamp(_ms * val);}
|
||||
|
||||
template <typename T> Timestamp operator / (const T val) const {return Timestamp(_ms / val);}
|
||||
|
||||
// /** cast to float */
|
||||
// operator float () const {return sec();}
|
||||
@@ -87,4 +91,22 @@ public:
|
||||
|
||||
};
|
||||
|
||||
namespace std {
|
||||
template<> class numeric_limits<Timestamp> {
|
||||
public:
|
||||
static Timestamp min() {
|
||||
const int64_t minVal = std::numeric_limits<int64_t>::min();
|
||||
return Timestamp::fromMS(minVal);
|
||||
}
|
||||
static Timestamp lowest() {
|
||||
const int64_t minVal = std::numeric_limits<int64_t>::min();
|
||||
return Timestamp::fromMS(minVal);
|
||||
}
|
||||
static Timestamp max() {
|
||||
const int64_t maxVal = std::numeric_limits<int64_t>::max();
|
||||
return Timestamp::fromMS(maxVal);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif // TIMESTAMP_H
|
||||
|
||||
Reference in New Issue
Block a user