45 lines
1.2 KiB
C++
45 lines
1.2 KiB
C++
//
|
|
// Created by scoliono on 10/14/23.
|
|
//
|
|
|
|
#ifndef FEMMAPS_SIGALERTROAD_H
|
|
#define FEMMAPS_SIGALERTROAD_H
|
|
|
|
#include "Road.h"
|
|
#include "RoadSensor.h"
|
|
#include "SigalertTypes.h"
|
|
#include "../include/IntervalTree.h"
|
|
#include "../include/json.hpp"
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
|
|
class SigalertRoadSection;
|
|
class SigalertRoadSensor;
|
|
|
|
class SigalertRoad : public Road {
|
|
|
|
public:
|
|
SigalertRoad(int id, const SigalertRoadJson& json);
|
|
inline int id() const { return m_id; }
|
|
inline const char* name() const { return m_name.c_str(); }
|
|
inline const std::vector<SigalertRoadSection*>& sections() const { return m_sections; }
|
|
inline const std::vector<RoadSensor*>& sensors() const { return m_sensors; }
|
|
inline const IntervalTree<int, int>& speedLimits() const { return m_sensor_speedlimits; }
|
|
|
|
void addSection(SigalertRoadSection* section);
|
|
void populateSensors(const std::vector<SigalertRoadSensor*>& sensors);
|
|
|
|
private:
|
|
int m_id;
|
|
std::string m_name;
|
|
std::vector<SigalertRoadSection*> m_sections;
|
|
int m_section_idx_range[2];
|
|
std::vector<RoadSensor*> m_sensors;
|
|
IntervalTree<int, int> m_sensor_speedlimits;
|
|
|
|
};
|
|
|
|
|
|
#endif //FEMMAPS_SIGALERTROAD_H
|