37 lines
978 B
C++
37 lines
978 B
C++
/*
|
||
* © Copyright 2014 – Urheberrechtshinweis
|
||
* Alle Rechte vorbehalten / All Rights Reserved
|
||
*
|
||
* Programmcode ist urheberrechtlich geschuetzt.
|
||
* Das Urheberrecht liegt, soweit nicht ausdruecklich anders gekennzeichnet, bei Frank Ebner.
|
||
* Keine Verwendung ohne explizite Genehmigung.
|
||
* (vgl. § 106 ff UrhG / § 97 UrhG)
|
||
*/
|
||
|
||
#ifndef BEACONMEASUREMENTS_H
|
||
#define BEACONMEASUREMENTS_H
|
||
|
||
#include <vector>
|
||
|
||
#include "BeaconMeasurement.h"
|
||
|
||
/**
|
||
* group of several beacon measurements
|
||
*/
|
||
struct BeaconMeasurements {
|
||
|
||
std::vector<BeaconMeasurement> entries;
|
||
|
||
/** remove entries older then 3000 ms*/
|
||
void removeOld(const Timestamp latestTS) {
|
||
auto lambda = [latestTS] (const BeaconMeasurement& e) {
|
||
Timestamp age = latestTS - e.getTimestamp();
|
||
return age > Timestamp::fromMS(1000*3);
|
||
};
|
||
entries.erase(std::remove_if(entries.begin(), entries.end(), lambda), entries.end());
|
||
}
|
||
|
||
};
|
||
|
||
#endif // BEACONMEASUREMENTS_H
|