23 const int trajectory_id,
24 const std::unordered_set<std::string>& expected_sensor_ids,
26 for (
const auto& sensor_id : expected_sensor_ids) {
27 const auto queue_key =
QueueKey{trajectory_id, sensor_id};
29 [callback, sensor_id](std::unique_ptr<Data> data) {
30 callback(sensor_id, std::move(data));
37 for (
const auto& queue_key :
queue_keys_[trajectory_id]) {
43 std::unique_ptr<Data> data) {
44 QueueKey queue_key{trajectory_id, data->GetSensorId()};
45 queue_.
Add(std::move(queue_key), std::move(data));
std::function< void(const std::string &, std::unique_ptr< Data >)> Callback
void FinishTrajectory(int trajectory_id) override
QueueKey GetBlocker() const
common::optional< int > GetBlockingTrajectoryId() const override
void AddSensorData(int trajectory_id, std::unique_ptr< Data > data) override
void AddTrajectory(int trajectory_id, const std::unordered_set< std::string > &expected_sensor_ids, const Callback &callback) override
std::unordered_map< int, std::vector< QueueKey > > queue_keys_
void AddQueue(const QueueKey &queue_key, Callback callback)
void MarkQueueAsFinished(const QueueKey &queue_key)
void Add(const QueueKey &queue_key, std::unique_ptr< Data > data)