osrm-backend/include/extractor/graph_compressor.hpp
Moritz Kobitzsch 2e9a7d9c1a refactor restriction parsing / extraction to actual types
Makes turn restrictions into dedicated structures and diferentiates between them via a variant.
Ensures that we do not accidentally mess up ID types within our application.
In addition this improves the restriction performance by only parsing all edges
once at the cost of (at the time of writing) 22MB in terms of main memory usage.
2017-07-31 09:36:25 +02:00

40 lines
928 B
C++

#ifndef GEOMETRY_COMPRESSOR_HPP
#define GEOMETRY_COMPRESSOR_HPP
#include "util/typedefs.hpp"
#include "util/node_based_graph.hpp"
#include <memory>
#include <unordered_set>
#include <vector>
namespace osrm
{
namespace extractor
{
class CompressedEdgeContainer;
struct TurnRestriction;
class GraphCompressor
{
using EdgeData = util::NodeBasedDynamicGraph::EdgeData;
public:
void Compress(const std::unordered_set<NodeID> &barrier_nodes,
const std::unordered_set<NodeID> &traffic_lights,
std::vector<TurnRestriction> &turn_restrictions,
util::NodeBasedDynamicGraph &graph,
CompressedEdgeContainer &geometry_compressor);
private:
void PrintStatistics(unsigned original_number_of_nodes,
unsigned original_number_of_edges,
const util::NodeBasedDynamicGraph &graph) const;
};
}
}
#endif