aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libtmi8/include/tmi8/kv1_index.hpp
blob: 621acf63b0980e57ab525fa691ec84a7d9b6f6f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
// vim:set sw=2 ts=2 sts et:

#ifndef OEUF_LIBTMI8_KV1_INDEX_HPP
#define OEUF_LIBTMI8_KV1_INDEX_HPP

#include <unordered_map>

#include <boost/container_hash/hash.hpp>

#include <tmi8/kv1_types.hpp>

struct Kv1Index {
  Kv1Records *records;

  explicit Kv1Index(Kv1Records *records);

  std::unordered_map<
    Kv1OrganizationalUnit::Key,
    Kv1OrganizationalUnit *,
    boost::hash<Kv1OrganizationalUnit::Key>> organizational_units;
  std::unordered_map<
    Kv1HigherOrganizationalUnit::Key,
    Kv1HigherOrganizationalUnit *,
    boost::hash<Kv1HigherOrganizationalUnit::Key>> higher_organizational_units;
  std::unordered_map<
    Kv1UserStopPoint::Key,
    Kv1UserStopPoint *,
    boost::hash<Kv1UserStopPoint::Key>> user_stop_points;
  std::unordered_map<
    Kv1UserStopArea::Key,
    Kv1UserStopArea *,
    boost::hash<Kv1UserStopArea::Key>> user_stop_areas;
  std::unordered_map<
    Kv1TimingLink::Key,
    Kv1TimingLink *,
    boost::hash<Kv1TimingLink::Key>> timing_links;
  std::unordered_map<
    Kv1Link::Key,
    Kv1Link *,
    boost::hash<Kv1Link::Key>> links;
  std::unordered_map<
    Kv1Line::Key,
    Kv1Line *,
    boost::hash<Kv1Line::Key>> lines;
  std::unordered_map<
    Kv1Destination::Key,
    Kv1Destination *,
    boost::hash<Kv1Destination::Key>> destinations;
  std::unordered_map<
    Kv1JourneyPattern::Key,
    Kv1JourneyPattern *,
    boost::hash<Kv1JourneyPattern::Key>> journey_patterns;
  std::unordered_map<
    Kv1ConcessionFinancerRelation::Key,
    Kv1ConcessionFinancerRelation *,
    boost::hash<Kv1ConcessionFinancerRelation::Key>> concession_financer_relations;
  std::unordered_map<
    Kv1ConcessionArea::Key,
    Kv1ConcessionArea *,
    boost::hash<Kv1ConcessionArea::Key>> concession_areas;
  std::unordered_map<
    Kv1Financer::Key,
    Kv1Financer *,
    boost::hash<Kv1Financer::Key>> financers;
  std::unordered_map<
    Kv1JourneyPatternTimingLink::Key,
    Kv1JourneyPatternTimingLink *,
    boost::hash<Kv1JourneyPatternTimingLink::Key>> journey_pattern_timing_links;
  std::unordered_map<
    Kv1Point::Key,
    Kv1Point *,
    boost::hash<Kv1Point::Key>> points;
  std::unordered_map<
    Kv1PointOnLink::Key,
    Kv1PointOnLink *,
    boost::hash<Kv1PointOnLink::Key>> point_on_links;
  std::unordered_map<
    Kv1Icon::Key,
    Kv1Icon *,
    boost::hash<Kv1Icon::Key>> icons;
  std::unordered_map<
    Kv1Notice::Key,
    Kv1Notice *,
    boost::hash<Kv1Notice::Key>> notices;
  std::unordered_map<
    Kv1TimeDemandGroup::Key,
    Kv1TimeDemandGroup *,
    boost::hash<Kv1TimeDemandGroup::Key>> time_demand_groups;
  std::unordered_map<
    Kv1TimeDemandGroupRunTime::Key,
    Kv1TimeDemandGroupRunTime *,
    boost::hash<Kv1TimeDemandGroupRunTime::Key>> time_demand_group_run_times;
  std::unordered_map<
    Kv1PeriodGroup::Key,
    Kv1PeriodGroup *,
    boost::hash<Kv1PeriodGroup::Key>> period_groups;
  std::unordered_map<
    Kv1SpecificDay::Key,
    Kv1SpecificDay *,
    boost::hash<Kv1SpecificDay::Key>> specific_days;
  std::unordered_map<
    Kv1TimetableVersion::Key,
    Kv1TimetableVersion *,
    boost::hash<Kv1TimetableVersion::Key>> timetable_versions;
  std::unordered_map<
    Kv1PublicJourney::Key,
    Kv1PublicJourney *,
    boost::hash<Kv1PublicJourney::Key>> public_journeys;
  std::unordered_map<
    Kv1PeriodGroupValidity::Key,
    Kv1PeriodGroupValidity *,
    boost::hash<Kv1PeriodGroupValidity::Key>> period_group_validities;
  std::unordered_map<
    Kv1ExceptionalOperatingDay::Key,
    Kv1ExceptionalOperatingDay *,
    boost::hash<Kv1ExceptionalOperatingDay::Key>> exceptional_operating_days;
  std::unordered_map<
    Kv1ScheduleVersion::Key,
    Kv1ScheduleVersion *,
    boost::hash<Kv1ScheduleVersion::Key>> schedule_versions;
  std::unordered_map<
    Kv1PublicJourneyPassingTimes::Key,
    Kv1PublicJourneyPassingTimes *,
    boost::hash<Kv1PublicJourneyPassingTimes::Key>> public_journey_passing_times;
  std::unordered_map<
    Kv1OperatingDay::Key,
    Kv1OperatingDay *,
    boost::hash<Kv1OperatingDay::Key>> operating_days;

  size_t size() const;
};

void kv1LinkRecords(Kv1Index &index);

#endif // OEUF_LIBTMI8_KV1_INDEX_HPP