-
Notifications
You must be signed in to change notification settings - Fork 3.4k
/
files.hpp
576 lines (469 loc) · 23.5 KB
/
files.hpp
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
#ifndef OSRM_EXTRACTOR_FILES_HPP
#define OSRM_EXTRACTOR_FILES_HPP
#include "extractor/edge_based_edge.hpp"
#include "extractor/node_data_container.hpp"
#include "extractor/profile_properties.hpp"
#include "extractor/query_node.hpp"
#include "extractor/serialization.hpp"
#include "extractor/turn_lane_types.hpp"
#include "util/coordinate.hpp"
#include "util/guidance/bearing_class.hpp"
#include "util/guidance/entry_class.hpp"
#include "util/guidance/turn_lanes.hpp"
#include "util/packed_vector.hpp"
#include "util/range_table.hpp"
#include "util/serialization.hpp"
#include <boost/assert.hpp>
namespace osrm::extractor::files
{
// writes the .osrm.icd file
template <typename IntersectionBearingsT, typename EntryClassVectorT>
void writeIntersections(const std::filesystem::path &path,
const IntersectionBearingsT &intersection_bearings,
const EntryClassVectorT &entry_classes)
{
static_assert(std::is_same<IntersectionBearingsContainer, IntersectionBearingsT>::value ||
std::is_same<IntersectionBearingsView, IntersectionBearingsT>::value,
"");
storage::tar::FileWriter writer(path, storage::tar::FileWriter::GenerateFingerprint);
serialization::write(writer, "/common/intersection_bearings", intersection_bearings);
storage::serialization::write(writer, "/common/entry_classes", entry_classes);
}
// read the .osrm.icd file
template <typename IntersectionBearingsT, typename EntryClassVectorT>
void readIntersections(const std::filesystem::path &path,
IntersectionBearingsT &intersection_bearings,
EntryClassVectorT &entry_classes)
{
static_assert(std::is_same<IntersectionBearingsContainer, IntersectionBearingsT>::value ||
std::is_same<IntersectionBearingsView, IntersectionBearingsT>::value,
"");
storage::tar::FileReader reader(path, storage::tar::FileReader::VerifyFingerprint);
serialization::read(reader, "/common/intersection_bearings", intersection_bearings);
storage::serialization::read(reader, "/common/entry_classes", entry_classes);
}
// reads .osrm.properties
inline void readProfileProperties(const std::filesystem::path &path, ProfileProperties &properties)
{
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
serialization::read(reader, "/common/properties", properties);
}
// writes .osrm.properties
inline void writeProfileProperties(const std::filesystem::path &path,
const ProfileProperties &properties)
{
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
storage::tar::FileWriter writer{path, fingerprint};
serialization::write(writer, "/common/properties", properties);
}
template <typename EdgeBasedEdgeVector>
void writeEdgeBasedGraph(const std::filesystem::path &path,
EdgeID const number_of_edge_based_nodes,
const EdgeBasedEdgeVector &edge_based_edge_list,
const std::uint32_t connectivity_checksum)
{
static_assert(std::is_same<typename EdgeBasedEdgeVector::value_type, EdgeBasedEdge>::value, "");
storage::tar::FileWriter writer(path, storage::tar::FileWriter::GenerateFingerprint);
writer.WriteElementCount64("/common/number_of_edge_based_nodes", 1);
writer.WriteFrom("/common/number_of_edge_based_nodes", number_of_edge_based_nodes);
storage::serialization::write(writer, "/common/edge_based_edge_list", edge_based_edge_list);
writer.WriteElementCount64("/common/connectivity_checksum", 1);
writer.WriteFrom("/common/connectivity_checksum", connectivity_checksum);
}
// reads .osrm.ebg file
template <typename EdgeBasedEdgeVector>
void readEdgeBasedGraph(const std::filesystem::path &path,
EdgeID &number_of_edge_based_nodes,
EdgeBasedEdgeVector &edge_based_edge_list,
std::uint32_t &connectivity_checksum)
{
static_assert(std::is_same<typename EdgeBasedEdgeVector::value_type, EdgeBasedEdge>::value, "");
storage::tar::FileReader reader(path, storage::tar::FileReader::VerifyFingerprint);
reader.ReadInto("/common/number_of_edge_based_nodes", number_of_edge_based_nodes);
storage::serialization::read(reader, "/common/edge_based_edge_list", edge_based_edge_list);
reader.ReadInto("/common/connectivity_checksum", connectivity_checksum);
}
// reads .osrm.nbg_nodes
template <typename CoordinatesT, typename PackedOSMIDsT>
void readNodes(const std::filesystem::path &path,
CoordinatesT &coordinates,
PackedOSMIDsT &osm_node_ids)
{
static_assert(std::is_same<typename CoordinatesT::value_type, util::Coordinate>::value, "");
static_assert(std::is_same<typename PackedOSMIDsT::value_type, OSMNodeID>::value, "");
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
storage::serialization::read(reader, "/common/nbn_data/coordinates", coordinates);
util::serialization::read(reader, "/common/nbn_data/osm_node_ids", osm_node_ids);
}
// reads only coordinates from .osrm.nbg_nodes
template <typename CoordinatesT>
void readNodeCoordinates(const std::filesystem::path &path, CoordinatesT &coordinates)
{
static_assert(std::is_same<typename CoordinatesT::value_type, util::Coordinate>::value, "");
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
storage::serialization::read(reader, "/common/nbn_data/coordinates", coordinates);
}
// writes .osrm.nbg_nodes
template <typename CoordinatesT, typename PackedOSMIDsT>
void writeNodes(const std::filesystem::path &path,
const CoordinatesT &coordinates,
const PackedOSMIDsT &osm_node_ids)
{
static_assert(std::is_same<typename CoordinatesT::value_type, util::Coordinate>::value, "");
static_assert(std::is_same<typename PackedOSMIDsT::value_type, OSMNodeID>::value, "");
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
storage::tar::FileWriter writer{path, fingerprint};
storage::serialization::write(writer, "/common/nbn_data/coordinates", coordinates);
util::serialization::write(writer, "/common/nbn_data/osm_node_ids", osm_node_ids);
}
// reads .osrm.cnbg_to_ebg
inline void readNBGMapping(const std::filesystem::path &path, std::vector<NBGToEBG> &mapping)
{
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
storage::serialization::read(reader, "/common/cnbg_to_ebg", mapping);
}
// writes .osrm.cnbg_to_ebg
inline void writeNBGMapping(const std::filesystem::path &path, const std::vector<NBGToEBG> &mapping)
{
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
storage::tar::FileWriter writer{path, fingerprint};
storage::serialization::write(writer, "/common/cnbg_to_ebg", mapping);
}
// reads .osrm.datasource_names
inline void readDatasources(const std::filesystem::path &path, Datasources &sources)
{
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
serialization::read(reader, "/common/data_sources_names", sources);
}
// writes .osrm.datasource_names
inline void writeDatasources(const std::filesystem::path &path, Datasources &sources)
{
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
storage::tar::FileWriter writer{path, fingerprint};
serialization::write(writer, "/common/data_sources_names", sources);
}
// reads .osrm.geometry
template <typename SegmentDataT>
void readSegmentData(const std::filesystem::path &path, SegmentDataT &segment_data)
{
static_assert(std::is_same<SegmentDataContainer, SegmentDataT>::value ||
std::is_same<SegmentDataView, SegmentDataT>::value,
"");
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
serialization::read(reader, "/common/segment_data", segment_data);
}
// writes .osrm.geometry
template <typename SegmentDataT>
void writeSegmentData(const std::filesystem::path &path, const SegmentDataT &segment_data)
{
static_assert(std::is_same<SegmentDataContainer, SegmentDataT>::value ||
std::is_same<SegmentDataView, SegmentDataT>::value,
"");
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
storage::tar::FileWriter writer{path, fingerprint};
serialization::write(writer, "/common/segment_data", segment_data);
}
// reads .osrm.ebg_nodes
template <typename NodeDataT>
inline void readNodeData(const std::filesystem::path &path, NodeDataT &node_data)
{
static_assert(std::is_same<EdgeBasedNodeDataContainer, NodeDataT>::value ||
std::is_same<EdgeBasedNodeDataView, NodeDataT>::value ||
std::is_same<EdgeBasedNodeDataExternalContainer, NodeDataT>::value,
"");
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
serialization::read(reader, "/common/ebg_node_data", node_data);
}
// writes .osrm.ebg_nodes
template <typename NodeDataT>
inline void writeNodeData(const std::filesystem::path &path, const NodeDataT &node_data)
{
static_assert(std::is_same<EdgeBasedNodeDataContainer, NodeDataT>::value ||
std::is_same<EdgeBasedNodeDataView, NodeDataT>::value ||
std::is_same<EdgeBasedNodeDataExternalContainer, NodeDataT>::value,
"");
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
storage::tar::FileWriter writer{path, fingerprint};
serialization::write(writer, "/common/ebg_node_data", node_data);
}
// reads .osrm.tls
template <typename OffsetsT, typename MaskT>
inline void readTurnLaneDescriptions(const std::filesystem::path &path,
OffsetsT &turn_offsets,
MaskT &turn_masks)
{
static_assert(std::is_same<typename MaskT::value_type, extractor::TurnLaneType::Mask>::value,
"");
static_assert(std::is_same<typename OffsetsT::value_type, std::uint32_t>::value, "");
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
storage::serialization::read(reader, "/common/turn_lanes/offsets", turn_offsets);
storage::serialization::read(reader, "/common/turn_lanes/masks", turn_masks);
}
// writes .osrm.tls
template <typename OffsetsT, typename MaskT>
inline void writeTurnLaneDescriptions(const std::filesystem::path &path,
const OffsetsT &turn_offsets,
const MaskT &turn_masks)
{
static_assert(std::is_same<typename MaskT::value_type, extractor::TurnLaneType::Mask>::value,
"");
static_assert(std::is_same<typename OffsetsT::value_type, std::uint32_t>::value, "");
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
storage::tar::FileWriter writer{path, fingerprint};
storage::serialization::write(writer, "/common/turn_lanes/offsets", turn_offsets);
storage::serialization::write(writer, "/common/turn_lanes/masks", turn_masks);
}
// reads .osrm.tld
template <typename TurnLaneDataT>
inline void readTurnLaneData(const std::filesystem::path &path, TurnLaneDataT &turn_lane_data)
{
static_assert(
std::is_same<typename TurnLaneDataT::value_type, util::guidance::LaneTupleIdPair>::value,
"");
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
storage::serialization::read(reader, "/common/turn_lanes/data", turn_lane_data);
}
// writes .osrm.tld
template <typename TurnLaneDataT>
inline void writeTurnLaneData(const std::filesystem::path &path,
const TurnLaneDataT &turn_lane_data)
{
static_assert(
std::is_same<typename TurnLaneDataT::value_type, util::guidance::LaneTupleIdPair>::value,
"");
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
storage::tar::FileWriter writer{path, fingerprint};
storage::serialization::write(writer, "/common/turn_lanes/data", turn_lane_data);
}
// reads .osrm.timestamp
template <typename TimestampDataT>
inline void readTimestamp(const std::filesystem::path &path, TimestampDataT ×tamp)
{
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
storage::serialization::read(reader, "/common/timestamp", timestamp);
}
// writes .osrm.timestamp
template <typename TimestampDataT>
inline void writeTimestamp(const std::filesystem::path &path, const TimestampDataT ×tamp)
{
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
storage::tar::FileWriter writer{path, fingerprint};
storage::serialization::write(writer, "/common/timestamp", timestamp);
}
// reads .osrm.maneuver_overrides
template <typename StorageManeuverOverrideT, typename NodeSequencesT>
inline void readManeuverOverrides(const std::filesystem::path &path,
StorageManeuverOverrideT &maneuver_overrides,
NodeSequencesT &node_sequences)
{
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
storage::serialization::read(
reader, "/common/maneuver_overrides/overrides", maneuver_overrides);
storage::serialization::read(
reader, "/common/maneuver_overrides/node_sequences", node_sequences);
}
// writes .osrm.maneuver_overrides
inline void writeManeuverOverrides(const std::filesystem::path &path,
const std::vector<StorageManeuverOverride> &maneuver_overrides,
const std::vector<NodeID> &node_sequences)
{
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
storage::tar::FileWriter writer{path, fingerprint};
storage::serialization::write(
writer, "/common/maneuver_overrides/overrides", maneuver_overrides);
storage::serialization::write(
writer, "/common/maneuver_overrides/node_sequences", node_sequences);
}
// writes .osrm.turn_weight_penalties
template <typename TurnPenaltyT>
inline void writeTurnWeightPenalty(const std::filesystem::path &path,
const TurnPenaltyT &turn_penalty)
{
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
storage::tar::FileWriter writer{path, fingerprint};
storage::serialization::write(writer, "/common/turn_penalty/weight", turn_penalty);
}
// read .osrm.turn_weight_penalties
template <typename TurnPenaltyT>
inline void readTurnWeightPenalty(const std::filesystem::path &path, TurnPenaltyT &turn_penalty)
{
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
storage::serialization::read(reader, "/common/turn_penalty/weight", turn_penalty);
}
// writes .osrm.turn_duration_penalties
template <typename TurnPenaltyT>
inline void writeTurnDurationPenalty(const std::filesystem::path &path,
const TurnPenaltyT &turn_penalty)
{
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
storage::tar::FileWriter writer{path, fingerprint};
storage::serialization::write(writer, "/common/turn_penalty/duration", turn_penalty);
}
// read .osrm.turn_weight_penalties
template <typename TurnPenaltyT>
inline void readTurnDurationPenalty(const std::filesystem::path &path, TurnPenaltyT &turn_penalty)
{
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
storage::serialization::read(reader, "/common/turn_penalty/duration", turn_penalty);
}
// writes .osrm.turn_penalties_index
template <typename TurnIndexT>
inline void writeTurnPenaltiesIndex(const std::filesystem::path &path,
const TurnIndexT &turn_penalties_index)
{
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
storage::tar::FileWriter writer{path, fingerprint};
storage::serialization::write(writer, "/extractor/turn_index", turn_penalties_index);
}
// read .osrm.turn_penalties_index
template <typename TurnIndexT>
inline void readTurnPenaltiesIndex(const std::filesystem::path &path,
TurnIndexT &turn_penalties_index)
{
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
storage::serialization::read(reader, "/extractor/turn_index", turn_penalties_index);
}
// writes .osrm.restrictions
template <typename ConditionalRestrictionsT>
inline void writeConditionalRestrictions(const std::filesystem::path &path,
const ConditionalRestrictionsT &conditional_restrictions)
{
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
storage::tar::FileWriter writer{path, fingerprint};
serialization::write(writer, "/common/conditional_restrictions", conditional_restrictions);
}
// read .osrm.restrictions
template <typename ConditionalRestrictionsT>
inline void readConditionalRestrictions(const std::filesystem::path &path,
ConditionalRestrictionsT &conditional_restrictions)
{
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
serialization::read(reader, "/common/conditional_restrictions", conditional_restrictions);
}
// reads .osrm file which is a temporary file of osrm-extract
template <typename PackedOSMIDsT>
void readRawNBGraph(const std::filesystem::path &path,
std::vector<util::Coordinate> &coordinates,
PackedOSMIDsT &osm_node_ids,
std::vector<extractor::NodeBasedEdge> &edge_list)
{
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
auto number_of_nodes = reader.ReadElementCount64("/extractor/nodes");
coordinates.resize(number_of_nodes);
osm_node_ids.reserve(number_of_nodes);
auto index = 0;
auto decode = [&](const auto ¤t_node)
{
coordinates[index].lon = current_node.lon;
coordinates[index].lat = current_node.lat;
osm_node_ids.push_back(current_node.node_id);
index++;
};
reader.ReadStreaming<extractor::QueryNode>("/extractor/nodes",
boost::make_function_output_iterator(decode));
storage::serialization::read(reader, "/extractor/edges", edge_list);
}
template <typename NameTableT> void readNames(const std::filesystem::path &path, NameTableT &table)
{
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
serialization::read(reader, "/common/names", table);
}
template <typename NameTableT>
void writeNames(const std::filesystem::path &path, const NameTableT &table)
{
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
storage::tar::FileWriter writer{path, fingerprint};
serialization::write(writer, "/common/names", table);
}
template <typename NodeWeightsVectorT>
void readEdgeBasedNodeWeights(const std::filesystem::path &path, NodeWeightsVectorT &weights)
{
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
storage::serialization::read(reader, "/extractor/edge_based_node_weights", weights);
}
template <typename NodeDistancesVectorT>
void readEdgeBasedNodeDistances(const std::filesystem::path &path, NodeDistancesVectorT &distances)
{
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
storage::serialization::read(reader, "/extractor/edge_based_node_distances", distances);
}
template <typename NodeWeightsVectorT, typename NodeDurationsVectorT, typename NodeDistancesVectorT>
void writeEdgeBasedNodeWeightsDurationsDistances(const std::filesystem::path &path,
const NodeWeightsVectorT &weights,
const NodeDurationsVectorT &durations,
const NodeDistancesVectorT &distances)
{
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
storage::tar::FileWriter writer{path, fingerprint};
storage::serialization::write(writer, "/extractor/edge_based_node_weights", weights);
storage::serialization::write(writer, "/extractor/edge_based_node_durations", durations);
storage::serialization::write(writer, "/extractor/edge_based_node_distances", distances);
}
template <typename NodeWeightsVectorT, typename NodeDurationsVectorT>
void readEdgeBasedNodeWeightsDurations(const std::filesystem::path &path,
NodeWeightsVectorT &weights,
NodeDurationsVectorT &durations)
{
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
storage::serialization::read(reader, "/extractor/edge_based_node_weights", weights);
storage::serialization::read(reader, "/extractor/edge_based_node_durations", durations);
}
template <typename NodeWeightsVectorT, typename NodeDurationsVectorT>
void writeEdgeBasedNodeWeightsDurations(const std::filesystem::path &path,
const NodeWeightsVectorT &weights,
const NodeDurationsVectorT &durations)
{
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
storage::tar::FileWriter writer{path, fingerprint};
storage::serialization::write(writer, "/extractor/edge_based_node_weights", weights);
storage::serialization::write(writer, "/extractor/edge_based_node_durations", durations);
}
template <typename RTreeT>
void writeRamIndex(const std::filesystem::path &path, const RTreeT &rtree)
{
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
storage::tar::FileWriter writer{path, fingerprint};
util::serialization::write(writer, "/common/rtree", rtree);
}
template <typename RTreeT> void readRamIndex(const std::filesystem::path &path, RTreeT &rtree)
{
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
util::serialization::read(reader, "/common/rtree", rtree);
}
template <typename EdgeListT>
void writeCompressedNodeBasedGraph(const std::filesystem::path &path, const EdgeListT &edge_list)
{
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
storage::tar::FileWriter writer{path, fingerprint};
storage::serialization::write(writer, "/extractor/cnbg", edge_list);
}
template <typename EdgeListT>
void readCompressedNodeBasedGraph(const std::filesystem::path &path, EdgeListT &edge_list)
{
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
storage::serialization::read(reader, "/extractor/cnbg", edge_list);
}
} // namespace osrm::extractor::files
#endif