#ifndef BEACONMEASUREMENTS_H #define BEACONMEASUREMENTS_H #include #include "BeaconMeasurement.h" /** * group of several beacon measurements */ struct BeaconMeasurements { std::vector 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