FemMaps/map/SigalertRoad.h

45 lines
1.2 KiB
C
Raw Permalink Normal View History

2023-10-15 01:49:35 -07:00
//
// Created by scoliono on 10/14/23.
//
#ifndef FEMMAPS_SIGALERTROAD_H
#define FEMMAPS_SIGALERTROAD_H
2023-10-30 00:53:00 -07:00
#include "Road.h"
#include "RoadSensor.h"
#include "SigalertTypes.h"
2023-10-15 01:49:35 -07:00
#include "../include/IntervalTree.h"
2023-10-30 00:53:00 -07:00
#include "../include/json.hpp"
#include <string>
#include <vector>
2023-10-15 01:49:35 -07:00
2023-10-30 00:53:00 -07:00
class SigalertRoadSection;
class SigalertRoadSensor;
class SigalertRoad : public Road {
2023-10-15 01:49:35 -07:00
public:
2023-10-30 00:53:00 -07:00
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; }
2023-10-15 01:49:35 -07:00
2023-10-30 00:53:00 -07:00
void addSection(SigalertRoadSection* section);
void populateSensors(const std::vector<SigalertRoadSensor*>& sensors);
2023-10-15 01:49:35 -07:00
2023-10-30 00:53:00 -07:00
private:
2023-10-15 01:49:35 -07:00
int m_id;
std::string m_name;
2023-10-30 00:53:00 -07:00
std::vector<SigalertRoadSection*> m_sections;
int m_section_idx_range[2];
std::vector<RoadSensor*> m_sensors;
2023-10-15 01:49:35 -07:00
IntervalTree<int, int> m_sensor_speedlimits;
2023-10-30 00:53:00 -07:00
2023-10-15 01:49:35 -07:00
};
#endif //FEMMAPS_SIGALERTROAD_H