diff options
author | Rutger Broekhoff | 2024-05-02 20:27:40 +0200 |
---|---|---|
committer | Rutger Broekhoff | 2024-05-02 20:27:40 +0200 |
commit | 17a3ea880402338420699e03bcb24181e4ff3924 (patch) | |
tree | da666ef91e0b60d20aa0b01529644c136fd1f4ab /lib/libtmi8/include/tmi8/kv1_index.hpp | |
download | oeuf-17a3ea880402338420699e03bcb24181e4ff3924.tar.gz oeuf-17a3ea880402338420699e03bcb24181e4ff3924.zip |
Initial commit
Based on dc4ba6a
Diffstat (limited to 'lib/libtmi8/include/tmi8/kv1_index.hpp')
-rw-r--r-- | lib/libtmi8/include/tmi8/kv1_index.hpp | 135 |
1 files changed, 135 insertions, 0 deletions
diff --git a/lib/libtmi8/include/tmi8/kv1_index.hpp b/lib/libtmi8/include/tmi8/kv1_index.hpp new file mode 100644 index 0000000..621acf6 --- /dev/null +++ b/lib/libtmi8/include/tmi8/kv1_index.hpp | |||
@@ -0,0 +1,135 @@ | |||
1 | // vim:set sw=2 ts=2 sts et: | ||
2 | |||
3 | #ifndef OEUF_LIBTMI8_KV1_INDEX_HPP | ||
4 | #define OEUF_LIBTMI8_KV1_INDEX_HPP | ||
5 | |||
6 | #include <unordered_map> | ||
7 | |||
8 | #include <boost/container_hash/hash.hpp> | ||
9 | |||
10 | #include <tmi8/kv1_types.hpp> | ||
11 | |||
12 | struct Kv1Index { | ||
13 | Kv1Records *records; | ||
14 | |||
15 | explicit Kv1Index(Kv1Records *records); | ||
16 | |||
17 | std::unordered_map< | ||
18 | Kv1OrganizationalUnit::Key, | ||
19 | Kv1OrganizationalUnit *, | ||
20 | boost::hash<Kv1OrganizationalUnit::Key>> organizational_units; | ||
21 | std::unordered_map< | ||
22 | Kv1HigherOrganizationalUnit::Key, | ||
23 | Kv1HigherOrganizationalUnit *, | ||
24 | boost::hash<Kv1HigherOrganizationalUnit::Key>> higher_organizational_units; | ||
25 | std::unordered_map< | ||
26 | Kv1UserStopPoint::Key, | ||
27 | Kv1UserStopPoint *, | ||
28 | boost::hash<Kv1UserStopPoint::Key>> user_stop_points; | ||
29 | std::unordered_map< | ||
30 | Kv1UserStopArea::Key, | ||
31 | Kv1UserStopArea *, | ||
32 | boost::hash<Kv1UserStopArea::Key>> user_stop_areas; | ||
33 | std::unordered_map< | ||
34 | Kv1TimingLink::Key, | ||
35 | Kv1TimingLink *, | ||
36 | boost::hash<Kv1TimingLink::Key>> timing_links; | ||
37 | std::unordered_map< | ||
38 | Kv1Link::Key, | ||
39 | Kv1Link *, | ||
40 | boost::hash<Kv1Link::Key>> links; | ||
41 | std::unordered_map< | ||
42 | Kv1Line::Key, | ||
43 | Kv1Line *, | ||
44 | boost::hash<Kv1Line::Key>> lines; | ||
45 | std::unordered_map< | ||
46 | Kv1Destination::Key, | ||
47 | Kv1Destination *, | ||
48 | boost::hash<Kv1Destination::Key>> destinations; | ||
49 | std::unordered_map< | ||
50 | Kv1JourneyPattern::Key, | ||
51 | Kv1JourneyPattern *, | ||
52 | boost::hash<Kv1JourneyPattern::Key>> journey_patterns; | ||
53 | std::unordered_map< | ||
54 | Kv1ConcessionFinancerRelation::Key, | ||
55 | Kv1ConcessionFinancerRelation *, | ||
56 | boost::hash<Kv1ConcessionFinancerRelation::Key>> concession_financer_relations; | ||
57 | std::unordered_map< | ||
58 | Kv1ConcessionArea::Key, | ||
59 | Kv1ConcessionArea *, | ||
60 | boost::hash<Kv1ConcessionArea::Key>> concession_areas; | ||
61 | std::unordered_map< | ||
62 | Kv1Financer::Key, | ||
63 | Kv1Financer *, | ||
64 | boost::hash<Kv1Financer::Key>> financers; | ||
65 | std::unordered_map< | ||
66 | Kv1JourneyPatternTimingLink::Key, | ||
67 | Kv1JourneyPatternTimingLink *, | ||
68 | boost::hash<Kv1JourneyPatternTimingLink::Key>> journey_pattern_timing_links; | ||
69 | std::unordered_map< | ||
70 | Kv1Point::Key, | ||
71 | Kv1Point *, | ||
72 | boost::hash<Kv1Point::Key>> points; | ||
73 | std::unordered_map< | ||
74 | Kv1PointOnLink::Key, | ||
75 | Kv1PointOnLink *, | ||
76 | boost::hash<Kv1PointOnLink::Key>> point_on_links; | ||
77 | std::unordered_map< | ||
78 | Kv1Icon::Key, | ||
79 | Kv1Icon *, | ||
80 | boost::hash<Kv1Icon::Key>> icons; | ||
81 | std::unordered_map< | ||
82 | Kv1Notice::Key, | ||
83 | Kv1Notice *, | ||
84 | boost::hash<Kv1Notice::Key>> notices; | ||
85 | std::unordered_map< | ||
86 | Kv1TimeDemandGroup::Key, | ||
87 | Kv1TimeDemandGroup *, | ||
88 | boost::hash<Kv1TimeDemandGroup::Key>> time_demand_groups; | ||
89 | std::unordered_map< | ||
90 | Kv1TimeDemandGroupRunTime::Key, | ||
91 | Kv1TimeDemandGroupRunTime *, | ||
92 | boost::hash<Kv1TimeDemandGroupRunTime::Key>> time_demand_group_run_times; | ||
93 | std::unordered_map< | ||
94 | Kv1PeriodGroup::Key, | ||
95 | Kv1PeriodGroup *, | ||
96 | boost::hash<Kv1PeriodGroup::Key>> period_groups; | ||
97 | std::unordered_map< | ||
98 | Kv1SpecificDay::Key, | ||
99 | Kv1SpecificDay *, | ||
100 | boost::hash<Kv1SpecificDay::Key>> specific_days; | ||
101 | std::unordered_map< | ||
102 | Kv1TimetableVersion::Key, | ||
103 | Kv1TimetableVersion *, | ||
104 | boost::hash<Kv1TimetableVersion::Key>> timetable_versions; | ||
105 | std::unordered_map< | ||
106 | Kv1PublicJourney::Key, | ||
107 | Kv1PublicJourney *, | ||
108 | boost::hash<Kv1PublicJourney::Key>> public_journeys; | ||
109 | std::unordered_map< | ||
110 | Kv1PeriodGroupValidity::Key, | ||
111 | Kv1PeriodGroupValidity *, | ||
112 | boost::hash<Kv1PeriodGroupValidity::Key>> period_group_validities; | ||
113 | std::unordered_map< | ||
114 | Kv1ExceptionalOperatingDay::Key, | ||
115 | Kv1ExceptionalOperatingDay *, | ||
116 | boost::hash<Kv1ExceptionalOperatingDay::Key>> exceptional_operating_days; | ||
117 | std::unordered_map< | ||
118 | Kv1ScheduleVersion::Key, | ||
119 | Kv1ScheduleVersion *, | ||
120 | boost::hash<Kv1ScheduleVersion::Key>> schedule_versions; | ||
121 | std::unordered_map< | ||
122 | Kv1PublicJourneyPassingTimes::Key, | ||
123 | Kv1PublicJourneyPassingTimes *, | ||
124 | boost::hash<Kv1PublicJourneyPassingTimes::Key>> public_journey_passing_times; | ||
125 | std::unordered_map< | ||
126 | Kv1OperatingDay::Key, | ||
127 | Kv1OperatingDay *, | ||
128 | boost::hash<Kv1OperatingDay::Key>> operating_days; | ||
129 | |||
130 | size_t size() const; | ||
131 | }; | ||
132 | |||
133 | void kv1LinkRecords(Kv1Index &index); | ||
134 | |||
135 | #endif // OEUF_LIBTMI8_KV1_INDEX_HPP | ||