worked on wifi-scanner for linux

new time-grouping for vap grouper
adjusted test-cases
minor changes/fixes/improvements
This commit is contained in:
2017-10-11 14:00:24 +02:00
parent 628be72e1f
commit da477866c1
13 changed files with 649 additions and 223 deletions

View File

@@ -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