ADD: added a sanitising function for the tracklist and tests
This commit is contained in:
@@ -6,13 +6,18 @@
|
||||
#include "nlohmann/json_fwd.hpp"
|
||||
#include <SimCore/Identifier.hpp>
|
||||
#include <SimCore/Messages/SimTrack.hpp>
|
||||
#include <cstddef>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <vector>
|
||||
|
||||
namespace SimControl
|
||||
{
|
||||
|
||||
|
||||
|
||||
class TrackList
|
||||
{
|
||||
public:
|
||||
@@ -26,12 +31,19 @@ namespace SimControl
|
||||
|
||||
|
||||
void getJsonTRackList(nlohmann::json &message);
|
||||
size_t getTracklistSize();
|
||||
|
||||
|
||||
private:
|
||||
mutable std::mutex mx_;
|
||||
std::map<std::string, std::shared_ptr<SimCore::SimTrack>> TrackStore_;
|
||||
|
||||
std::map<std::string, std::time_t> markedAsDeletedTracks_;
|
||||
|
||||
void checkTracksTimeout();
|
||||
|
||||
const int TrackTimeoutTime = 6;
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user