From 17a3ea880402338420699e03bcb24181e4ff3924 Mon Sep 17 00:00:00 2001 From: Rutger Broekhoff Date: Thu, 2 May 2024 20:27:40 +0200 Subject: Initial commit Based on dc4ba6a --- lib/libtmi8/include/tmi8/kv1_index.hpp | 135 +++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 lib/libtmi8/include/tmi8/kv1_index.hpp (limited to 'lib/libtmi8/include/tmi8/kv1_index.hpp') 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 @@ +// vim:set sw=2 ts=2 sts et: + +#ifndef OEUF_LIBTMI8_KV1_INDEX_HPP +#define OEUF_LIBTMI8_KV1_INDEX_HPP + +#include + +#include + +#include + +struct Kv1Index { + Kv1Records *records; + + explicit Kv1Index(Kv1Records *records); + + std::unordered_map< + Kv1OrganizationalUnit::Key, + Kv1OrganizationalUnit *, + boost::hash> organizational_units; + std::unordered_map< + Kv1HigherOrganizationalUnit::Key, + Kv1HigherOrganizationalUnit *, + boost::hash> higher_organizational_units; + std::unordered_map< + Kv1UserStopPoint::Key, + Kv1UserStopPoint *, + boost::hash> user_stop_points; + std::unordered_map< + Kv1UserStopArea::Key, + Kv1UserStopArea *, + boost::hash> user_stop_areas; + std::unordered_map< + Kv1TimingLink::Key, + Kv1TimingLink *, + boost::hash> timing_links; + std::unordered_map< + Kv1Link::Key, + Kv1Link *, + boost::hash> links; + std::unordered_map< + Kv1Line::Key, + Kv1Line *, + boost::hash> lines; + std::unordered_map< + Kv1Destination::Key, + Kv1Destination *, + boost::hash> destinations; + std::unordered_map< + Kv1JourneyPattern::Key, + Kv1JourneyPattern *, + boost::hash> journey_patterns; + std::unordered_map< + Kv1ConcessionFinancerRelation::Key, + Kv1ConcessionFinancerRelation *, + boost::hash> concession_financer_relations; + std::unordered_map< + Kv1ConcessionArea::Key, + Kv1ConcessionArea *, + boost::hash> concession_areas; + std::unordered_map< + Kv1Financer::Key, + Kv1Financer *, + boost::hash> financers; + std::unordered_map< + Kv1JourneyPatternTimingLink::Key, + Kv1JourneyPatternTimingLink *, + boost::hash> journey_pattern_timing_links; + std::unordered_map< + Kv1Point::Key, + Kv1Point *, + boost::hash> points; + std::unordered_map< + Kv1PointOnLink::Key, + Kv1PointOnLink *, + boost::hash> point_on_links; + std::unordered_map< + Kv1Icon::Key, + Kv1Icon *, + boost::hash> icons; + std::unordered_map< + Kv1Notice::Key, + Kv1Notice *, + boost::hash> notices; + std::unordered_map< + Kv1TimeDemandGroup::Key, + Kv1TimeDemandGroup *, + boost::hash> time_demand_groups; + std::unordered_map< + Kv1TimeDemandGroupRunTime::Key, + Kv1TimeDemandGroupRunTime *, + boost::hash> time_demand_group_run_times; + std::unordered_map< + Kv1PeriodGroup::Key, + Kv1PeriodGroup *, + boost::hash> period_groups; + std::unordered_map< + Kv1SpecificDay::Key, + Kv1SpecificDay *, + boost::hash> specific_days; + std::unordered_map< + Kv1TimetableVersion::Key, + Kv1TimetableVersion *, + boost::hash> timetable_versions; + std::unordered_map< + Kv1PublicJourney::Key, + Kv1PublicJourney *, + boost::hash> public_journeys; + std::unordered_map< + Kv1PeriodGroupValidity::Key, + Kv1PeriodGroupValidity *, + boost::hash> period_group_validities; + std::unordered_map< + Kv1ExceptionalOperatingDay::Key, + Kv1ExceptionalOperatingDay *, + boost::hash> exceptional_operating_days; + std::unordered_map< + Kv1ScheduleVersion::Key, + Kv1ScheduleVersion *, + boost::hash> schedule_versions; + std::unordered_map< + Kv1PublicJourneyPassingTimes::Key, + Kv1PublicJourneyPassingTimes *, + boost::hash> public_journey_passing_times; + std::unordered_map< + Kv1OperatingDay::Key, + Kv1OperatingDay *, + boost::hash> operating_days; + + size_t size() const; +}; + +void kv1LinkRecords(Kv1Index &index); + +#endif // OEUF_LIBTMI8_KV1_INDEX_HPP -- cgit v1.2.3