ADD: added Movement calculation and a Tracklist class
This commit is contained in:
62
include/Entities/Tracklist/Tracklist.hpp
Normal file
62
include/Entities/Tracklist/Tracklist.hpp
Normal file
@@ -0,0 +1,62 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "SimCore/Identifier.hpp"
|
||||
#include "SimCore/IdentifierMaker.hpp"
|
||||
#include <atomic>
|
||||
#include <cstddef>
|
||||
#include <list>
|
||||
#include <memory>
|
||||
|
||||
#include <SimCore/Position.hpp>
|
||||
#include <SimCore/Messages/Track.hpp>
|
||||
#include <SimCore/SafeMap.hpp>
|
||||
#include <Entities/Tracklist/TracklistItem.hpp>
|
||||
#include <thread>
|
||||
#include <loguru.hpp>
|
||||
|
||||
namespace TrackList
|
||||
{
|
||||
|
||||
class TrackList
|
||||
{
|
||||
public:
|
||||
TrackList(SimCore::Identifier OwnID);
|
||||
~TrackList();
|
||||
|
||||
void stopSanitizer();
|
||||
|
||||
SimCore::Identifier getTrackID(SimCore::ObjectSource source);
|
||||
|
||||
void addTrack(std::shared_ptr<SimCore::Track> track,SensorData sensorData);
|
||||
|
||||
std::shared_ptr<TracklistItem> getTrack(SimCore::Identifier TrackID);
|
||||
|
||||
std::vector<SimCore::Identifier> getAllIDs();
|
||||
|
||||
size_t size();
|
||||
|
||||
private:
|
||||
|
||||
const SimCore::Identifier OwnID_;
|
||||
|
||||
SimCore::IdentifierMaker IDMaker;
|
||||
|
||||
void tracklistSanitizer();
|
||||
|
||||
void addNewTrack(std::shared_ptr<SimCore::Track> track,SensorData sensorData);
|
||||
|
||||
std::map<std::string, std::shared_ptr<TracklistItem>> TrackList_;
|
||||
|
||||
mutable std::mutex mutex_;
|
||||
|
||||
std::thread sanitizerThread_;
|
||||
std::atomic_bool sanitizerIsRunning_;
|
||||
std::atomic_bool stopSanitizer_;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user