Simulateur Ferroviaire
Reconstruction et visualisation d'un réseau ferroviaire à partir de données GeoJSON — Win32 / WebView2 / Leaflet
Chargement...
Recherche...
Aucune correspondance
TopologyData.h
Aller à la documentation de ce fichier.
1
7#pragma once
8
9#include <memory>
10#include <vector>
11#include <unordered_map>
12
15
29{
30public:
31 std::vector<std::unique_ptr<StraightBlock>> straights;
32 std::vector<std::unique_ptr<SwitchBlock>> switches;
33
38 std::unordered_map<std::string, SwitchBlock*> switchIndex;
39 std::unordered_map<std::string, StraightBlock*> straightIndex;
40
44 void clear()
45 {
46 straights.clear();
47 switches.clear();
48 switchIndex.clear();
49 straightIndex.clear();
50 }
51
61 {
62 switchIndex.clear();
63 straightIndex.clear();
64
65 switchIndex.reserve(switches.size());
66 for (auto& sw : switches)
67 switchIndex[sw->getId()] = sw.get();
68
69 straightIndex.reserve(straights.size());
70 for (auto& st : straights)
71 straightIndex[st->getId()] = st.get();
72 }
73};
Modèle de domaine d'un bloc de voie droite (Straight).
Modèle de domaine d'un aiguillage ferroviaire à 3 branches.
Conteneur partagé entre tous les modules métier et la couche HMI.
Definition TopologyData.h:29
void buildIndex()
Construit les index id→ptr depuis les vecteurs.
Definition TopologyData.h:60
std::unordered_map< std::string, SwitchBlock * > switchIndex
Definition TopologyData.h:38
std::vector< std::unique_ptr< SwitchBlock > > switches
Definition TopologyData.h:32
void clear()
Vide les listes et les index (remise à zéro entre deux parsings).
Definition TopologyData.h:44
std::unordered_map< std::string, StraightBlock * > straightIndex
Definition TopologyData.h:39
std::vector< std::unique_ptr< StraightBlock > > straights
Definition TopologyData.h:31