ADD: added automatic delete of lost tracks
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <loguru.hpp>
|
||||
#include <SimCore/CallBackTimer.hpp>
|
||||
|
||||
namespace TrackList
|
||||
{
|
||||
@@ -25,6 +26,10 @@ namespace TrackList
|
||||
{
|
||||
public:
|
||||
TrackList();
|
||||
~TrackList();
|
||||
TrackList(const TrackList &other);
|
||||
TrackList& operator=(const TrackList & oter);
|
||||
|
||||
void addTrack(std::shared_ptr<SimCore::SensorTrack> Track);
|
||||
std::shared_ptr<SimCore::SensorTrack> getTrack(SimCore::Identifier);
|
||||
|
||||
@@ -36,12 +41,22 @@ namespace TrackList
|
||||
|
||||
void getJsonTRackList(nlohmann::json &message);
|
||||
std::map<std::string, std::shared_ptr<SimCore::SensorTrack>> getTrackStore();
|
||||
|
||||
|
||||
/**
|
||||
* @brief cheks the trackstore for old tracks to delete
|
||||
*
|
||||
*/
|
||||
void checkTrackStore();
|
||||
|
||||
private:
|
||||
mutable std::mutex mx_;
|
||||
std::map<std::string, std::shared_ptr<SimCore::SensorTrack>> TrackStore_;
|
||||
|
||||
/// seconds after the last updated a track gets deleted
|
||||
const int trackNoUpdateTime = 10;
|
||||
|
||||
CallBackTimer timer_;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user