add final/override keyword where possible to help compiler de-virtualize function calls
This commit is contained in:
parent
5efa9664db
commit
c63218a889
@ -59,10 +59,10 @@ template <class DataFacadeT> class GPXDescriptor : public BaseDescriptor<DataFac
|
|||||||
public:
|
public:
|
||||||
GPXDescriptor(DataFacadeT *facade) : facade(facade) {}
|
GPXDescriptor(DataFacadeT *facade) : facade(facade) {}
|
||||||
|
|
||||||
void SetConfig(const DescriptorConfig &c) { config = c; }
|
void SetConfig(const DescriptorConfig &c) final { config = c; }
|
||||||
|
|
||||||
// TODO: reorder parameters
|
// TODO: reorder parameters
|
||||||
void Run(const RawRouteData &raw_route, http::Reply &reply)
|
void Run(const RawRouteData &raw_route, http::Reply &reply) final
|
||||||
{
|
{
|
||||||
std::string header("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
|
std::string header("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
|
||||||
"<gpx creator=\"OSRM Routing Engine\" version=\"1.1\" "
|
"<gpx creator=\"OSRM Routing Engine\" version=\"1.1\" "
|
||||||
@ -79,7 +79,8 @@ template <class DataFacadeT> class GPXDescriptor : public BaseDescriptor<DataFac
|
|||||||
(!raw_route.unpacked_path_segments.front().empty());
|
(!raw_route.unpacked_path_segments.front().empty());
|
||||||
if (found_route)
|
if (found_route)
|
||||||
{
|
{
|
||||||
AddRoutePoint(raw_route.segment_end_coordinates.front().source_phantom.location, reply.content);
|
AddRoutePoint(raw_route.segment_end_coordinates.front().source_phantom.location,
|
||||||
|
reply.content);
|
||||||
|
|
||||||
for (const std::vector<PathData> &path_data_vector : raw_route.unpacked_path_segments)
|
for (const std::vector<PathData> &path_data_vector : raw_route.unpacked_path_segments)
|
||||||
{
|
{
|
||||||
@ -90,8 +91,8 @@ template <class DataFacadeT> class GPXDescriptor : public BaseDescriptor<DataFac
|
|||||||
AddRoutePoint(current_coordinate, reply.content);
|
AddRoutePoint(current_coordinate, reply.content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AddRoutePoint(raw_route.segment_end_coordinates.back().target_phantom.location, reply.content);
|
AddRoutePoint(raw_route.segment_end_coordinates.back().target_phantom.location,
|
||||||
|
reply.content);
|
||||||
}
|
}
|
||||||
std::string footer("</rte></gpx>");
|
std::string footer("</rte></gpx>");
|
||||||
reply.content.insert(reply.content.end(), footer.begin(), footer.end());
|
reply.content.insert(reply.content.end(), footer.begin(), footer.end());
|
||||||
|
@ -72,7 +72,7 @@ template <class DataFacadeT> class JSONDescriptor : public BaseDescriptor<DataFa
|
|||||||
public:
|
public:
|
||||||
JSONDescriptor(DataFacadeT *facade) : facade(facade), entered_restricted_area_count(0) {}
|
JSONDescriptor(DataFacadeT *facade) : facade(facade), entered_restricted_area_count(0) {}
|
||||||
|
|
||||||
void SetConfig(const DescriptorConfig &c) { config = c; }
|
void SetConfig(const DescriptorConfig &c) final { config = c; }
|
||||||
|
|
||||||
unsigned DescribeLeg(const std::vector<PathData> route_leg,
|
unsigned DescribeLeg(const std::vector<PathData> route_leg,
|
||||||
const PhantomNodes &leg_phantoms,
|
const PhantomNodes &leg_phantoms,
|
||||||
@ -88,13 +88,14 @@ template <class DataFacadeT> class JSONDescriptor : public BaseDescriptor<DataFa
|
|||||||
description_factory.AppendSegment(current_coordinate, path_data);
|
description_factory.AppendSegment(current_coordinate, path_data);
|
||||||
++added_element_count;
|
++added_element_count;
|
||||||
}
|
}
|
||||||
description_factory.SetEndSegment(leg_phantoms.target_phantom, target_traversed_in_reverse, is_via_leg);
|
description_factory.SetEndSegment(
|
||||||
|
leg_phantoms.target_phantom, target_traversed_in_reverse, is_via_leg);
|
||||||
++added_element_count;
|
++added_element_count;
|
||||||
BOOST_ASSERT((route_leg.size() + 1) == added_element_count);
|
BOOST_ASSERT((route_leg.size() + 1) == added_element_count);
|
||||||
return added_element_count;
|
return added_element_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Run(const RawRouteData &raw_route, http::Reply &reply)
|
void Run(const RawRouteData &raw_route, http::Reply &reply) final
|
||||||
{
|
{
|
||||||
JSON::Object json_result;
|
JSON::Object json_result;
|
||||||
if (INVALID_EDGE_WEIGHT == raw_route.shortest_path_length)
|
if (INVALID_EDGE_WEIGHT == raw_route.shortest_path_length)
|
||||||
@ -204,7 +205,9 @@ template <class DataFacadeT> class JSONDescriptor : public BaseDescriptor<DataFa
|
|||||||
current = facade->GetCoordinateOfNode(path_data.node);
|
current = facade->GetCoordinateOfNode(path_data.node);
|
||||||
alternate_description_factory.AppendSegment(current, path_data);
|
alternate_description_factory.AppendSegment(current, path_data);
|
||||||
}
|
}
|
||||||
alternate_description_factory.SetEndSegment(raw_route.segment_end_coordinates.back().target_phantom, raw_route.alt_source_traversed_in_reverse.back());
|
alternate_description_factory.SetEndSegment(
|
||||||
|
raw_route.segment_end_coordinates.back().target_phantom,
|
||||||
|
raw_route.alt_source_traversed_in_reverse.back());
|
||||||
alternate_description_factory.Run(facade, config.zoom_level);
|
alternate_description_factory.Run(facade, config.zoom_level);
|
||||||
|
|
||||||
if (config.geometry)
|
if (config.geometry)
|
||||||
@ -351,10 +354,13 @@ template <class DataFacadeT> class JSONDescriptor : public BaseDescriptor<DataFa
|
|||||||
UintToString(static_cast<int>(segment.length)) + "m");
|
UintToString(static_cast<int>(segment.length)) + "m");
|
||||||
const double bearing_value = (segment.bearing / 10.);
|
const double bearing_value = (segment.bearing / 10.);
|
||||||
json_instruction_row.values.push_back(Azimuth::Get(bearing_value));
|
json_instruction_row.values.push_back(Azimuth::Get(bearing_value));
|
||||||
json_instruction_row.values.push_back(static_cast<unsigned>(round(bearing_value)));
|
json_instruction_row.values.push_back(
|
||||||
|
static_cast<unsigned>(round(bearing_value)));
|
||||||
|
|
||||||
route_segments_list.emplace_back(
|
route_segments_list.emplace_back(
|
||||||
segment.name_id, static_cast<int>(segment.length), static_cast<unsigned>(route_segments_list.size()));
|
segment.name_id,
|
||||||
|
static_cast<int>(segment.length),
|
||||||
|
static_cast<unsigned>(route_segments_list.size()));
|
||||||
json_instruction_array.values.push_back(json_instruction_row);
|
json_instruction_array.values.push_back(json_instruction_row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ class ExtractionContainers
|
|||||||
|
|
||||||
ExtractionContainers();
|
ExtractionContainers();
|
||||||
|
|
||||||
virtual ~ExtractionContainers();
|
~ExtractionContainers();
|
||||||
|
|
||||||
void PrepareData(const std::string &output_file_name,
|
void PrepareData(const std::string &output_file_name,
|
||||||
const std::string &restrictions_file_name);
|
const std::string &restrictions_file_name);
|
||||||
|
@ -60,9 +60,9 @@ template <class DataFacadeT> class DistanceTablePlugin : public BasePlugin
|
|||||||
|
|
||||||
virtual ~DistanceTablePlugin() {}
|
virtual ~DistanceTablePlugin() {}
|
||||||
|
|
||||||
const std::string GetDescriptor() const { return descriptor_string; }
|
const std::string GetDescriptor() const final { return descriptor_string; }
|
||||||
|
|
||||||
void HandleRequest(const RouteParameters &route_parameters, http::Reply &reply)
|
void HandleRequest(const RouteParameters &route_parameters, http::Reply &reply) final
|
||||||
{
|
{
|
||||||
// check number of parameters
|
// check number of parameters
|
||||||
if (2 > route_parameters.coordinates.size())
|
if (2 > route_parameters.coordinates.size())
|
||||||
@ -77,7 +77,9 @@ template <class DataFacadeT> class DistanceTablePlugin : public BasePlugin
|
|||||||
if (std::any_of(begin(route_parameters.coordinates),
|
if (std::any_of(begin(route_parameters.coordinates),
|
||||||
end(route_parameters.coordinates),
|
end(route_parameters.coordinates),
|
||||||
[&](FixedPointCoordinate coordinate)
|
[&](FixedPointCoordinate coordinate)
|
||||||
{ return !coordinate.isValid(); }))
|
{
|
||||||
|
return !coordinate.isValid();
|
||||||
|
}))
|
||||||
{
|
{
|
||||||
reply = http::Reply::StockReply(http::Reply::badRequest);
|
reply = http::Reply::StockReply(http::Reply::badRequest);
|
||||||
return;
|
return;
|
||||||
|
@ -42,9 +42,9 @@ class HelloWorldPlugin : public BasePlugin
|
|||||||
public:
|
public:
|
||||||
HelloWorldPlugin() : descriptor_string("hello") {}
|
HelloWorldPlugin() : descriptor_string("hello") {}
|
||||||
virtual ~HelloWorldPlugin() {}
|
virtual ~HelloWorldPlugin() {}
|
||||||
const std::string GetDescriptor() const { return descriptor_string; }
|
const std::string GetDescriptor() const final { return descriptor_string; }
|
||||||
|
|
||||||
void HandleRequest(const RouteParameters &routeParameters, http::Reply &reply)
|
void HandleRequest(const RouteParameters &routeParameters, http::Reply &reply) final
|
||||||
{
|
{
|
||||||
reply.status = http::Reply::ok;
|
reply.status = http::Reply::ok;
|
||||||
|
|
||||||
@ -60,9 +60,11 @@ class HelloWorldPlugin : public BasePlugin
|
|||||||
json_result.values["instructions"] = (routeParameters.print_instructions ? "yes" : "no");
|
json_result.values["instructions"] = (routeParameters.print_instructions ? "yes" : "no");
|
||||||
json_result.values["geometry"] = (routeParameters.geometry ? "yes" : "no");
|
json_result.values["geometry"] = (routeParameters.geometry ? "yes" : "no");
|
||||||
json_result.values["compression"] = (routeParameters.compression ? "yes" : "no");
|
json_result.values["compression"] = (routeParameters.compression ? "yes" : "no");
|
||||||
json_result.values["output_format"] = (!routeParameters.output_format.empty() ? "yes" : "no");
|
json_result.values["output_format"] =
|
||||||
|
(!routeParameters.output_format.empty() ? "yes" : "no");
|
||||||
|
|
||||||
json_result.values["jsonp_parameter"] = (!routeParameters.jsonp_parameter.empty() ? "yes" : "no");
|
json_result.values["jsonp_parameter"] =
|
||||||
|
(!routeParameters.jsonp_parameter.empty() ? "yes" : "no");
|
||||||
json_result.values["language"] = (!routeParameters.language.empty() ? "yes" : "no");
|
json_result.values["language"] = (!routeParameters.language.empty() ? "yes" : "no");
|
||||||
|
|
||||||
temp_string = UintToString(static_cast<unsigned>(routeParameters.coordinates.size()));
|
temp_string = UintToString(static_cast<unsigned>(routeParameters.coordinates.size()));
|
||||||
|
@ -39,13 +39,12 @@ template <class DataFacadeT> class LocatePlugin : public BasePlugin
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit LocatePlugin(DataFacadeT *facade) : descriptor_string("locate"), facade(facade) {}
|
explicit LocatePlugin(DataFacadeT *facade) : descriptor_string("locate"), facade(facade) {}
|
||||||
const std::string GetDescriptor() const { return descriptor_string; }
|
const std::string GetDescriptor() const final { return descriptor_string; }
|
||||||
|
|
||||||
void HandleRequest(const RouteParameters &route_parameters, http::Reply &reply)
|
void HandleRequest(const RouteParameters &route_parameters, http::Reply &reply) final
|
||||||
{
|
{
|
||||||
// check number of parameters
|
// check number of parameters
|
||||||
if (route_parameters.coordinates.empty() ||
|
if (route_parameters.coordinates.empty() || !route_parameters.coordinates.front().isValid())
|
||||||
!route_parameters.coordinates.front().isValid())
|
|
||||||
{
|
{
|
||||||
reply = http::Reply::StockReply(http::Reply::badRequest);
|
reply = http::Reply::StockReply(http::Reply::badRequest);
|
||||||
return;
|
return;
|
||||||
|
@ -43,9 +43,9 @@ template <class DataFacadeT> class NearestPlugin : public BasePlugin
|
|||||||
public:
|
public:
|
||||||
explicit NearestPlugin(DataFacadeT *facade) : facade(facade), descriptor_string("nearest") {}
|
explicit NearestPlugin(DataFacadeT *facade) : facade(facade), descriptor_string("nearest") {}
|
||||||
|
|
||||||
const std::string GetDescriptor() const { return descriptor_string; }
|
const std::string GetDescriptor() const final { return descriptor_string; }
|
||||||
|
|
||||||
void HandleRequest(const RouteParameters &route_parameters, http::Reply &reply)
|
void HandleRequest(const RouteParameters &route_parameters, http::Reply &reply) final
|
||||||
{
|
{
|
||||||
// check number of parameters
|
// check number of parameters
|
||||||
if (route_parameters.coordinates.empty() || !route_parameters.coordinates.front().isValid())
|
if (route_parameters.coordinates.empty() || !route_parameters.coordinates.front().isValid())
|
||||||
|
@ -40,8 +40,8 @@ template <class DataFacadeT> class TimestampPlugin : public BasePlugin
|
|||||||
: facade(facade), descriptor_string("timestamp")
|
: facade(facade), descriptor_string("timestamp")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
const std::string GetDescriptor() const { return descriptor_string; }
|
const std::string GetDescriptor() const final { return descriptor_string; }
|
||||||
void HandleRequest(const RouteParameters &route_parameters, http::Reply &reply)
|
void HandleRequest(const RouteParameters &route_parameters, http::Reply &reply) final
|
||||||
{
|
{
|
||||||
reply.status = http::Reply::ok;
|
reply.status = http::Reply::ok;
|
||||||
JSON::Object json_result;
|
JSON::Object json_result;
|
||||||
|
@ -67,16 +67,18 @@ template <class DataFacadeT> class ViaRoutePlugin : public BasePlugin
|
|||||||
|
|
||||||
virtual ~ViaRoutePlugin() {}
|
virtual ~ViaRoutePlugin() {}
|
||||||
|
|
||||||
const std::string GetDescriptor() const { return descriptor_string; }
|
const std::string GetDescriptor() const final { return descriptor_string; }
|
||||||
|
|
||||||
void HandleRequest(const RouteParameters &route_parameters, http::Reply &reply)
|
void HandleRequest(const RouteParameters &route_parameters, http::Reply &reply) final
|
||||||
{
|
{
|
||||||
// check number of parameters
|
// check number of parameters
|
||||||
if (2 > route_parameters.coordinates.size() ||
|
if (2 > route_parameters.coordinates.size() ||
|
||||||
std::any_of(begin(route_parameters.coordinates),
|
std::any_of(begin(route_parameters.coordinates),
|
||||||
end(route_parameters.coordinates),
|
end(route_parameters.coordinates),
|
||||||
[&](FixedPointCoordinate coordinate)
|
[&](FixedPointCoordinate coordinate)
|
||||||
{ return !coordinate.isValid(); }))
|
{
|
||||||
|
return !coordinate.isValid();
|
||||||
|
}))
|
||||||
{
|
{
|
||||||
reply = http::Reply::StockReply(http::Reply::badRequest);
|
reply = http::Reply::StockReply(http::Reply::badRequest);
|
||||||
return;
|
return;
|
||||||
@ -125,7 +127,8 @@ template <class DataFacadeT> class ViaRoutePlugin : public BasePlugin
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
search_engine_ptr->shortest_path(raw_route.segment_end_coordinates, route_parameters.uturns, raw_route);
|
search_engine_ptr->shortest_path(
|
||||||
|
raw_route.segment_end_coordinates, route_parameters.uturns, raw_route);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (INVALID_EDGE_WEIGHT == raw_route.shortest_path_length)
|
if (INVALID_EDGE_WEIGHT == raw_route.shortest_path_length)
|
||||||
|
@ -62,9 +62,9 @@ template <class EdgeDataT> class BaseDataFacade
|
|||||||
|
|
||||||
virtual NodeID GetTarget(const EdgeID e) const = 0;
|
virtual NodeID GetTarget(const EdgeID e) const = 0;
|
||||||
|
|
||||||
virtual EdgeDataT &GetEdgeData(const EdgeID e) = 0;
|
// virtual EdgeDataT &GetEdgeData(const EdgeID e) = 0;
|
||||||
|
|
||||||
// virtual const EdgeDataT &GetEdgeData( const EdgeID e ) const = 0;
|
virtual const EdgeDataT &GetEdgeData(const EdgeID e) const = 0;
|
||||||
|
|
||||||
virtual EdgeID BeginEdges(const NodeID n) const = 0;
|
virtual EdgeID BeginEdges(const NodeID n) const = 0;
|
||||||
|
|
||||||
@ -100,7 +100,8 @@ template <class EdgeDataT> class BaseDataFacade
|
|||||||
PhantomNode &resulting_phantom_node,
|
PhantomNode &resulting_phantom_node,
|
||||||
const unsigned zoom_level) = 0;
|
const unsigned zoom_level) = 0;
|
||||||
|
|
||||||
virtual bool IncrementalFindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate,
|
virtual bool
|
||||||
|
IncrementalFindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate,
|
||||||
std::vector<PhantomNode> &resulting_phantom_node_vector,
|
std::vector<PhantomNode> &resulting_phantom_node_vector,
|
||||||
const unsigned zoom_level,
|
const unsigned zoom_level,
|
||||||
const unsigned number_of_results) = 0;
|
const unsigned number_of_results) = 0;
|
||||||
|
@ -71,8 +71,8 @@ template <class EdgeDataT> class InternalDataFacade : public BaseDataFacade<Edge
|
|||||||
ShM<unsigned, false>::vector m_geometry_indices;
|
ShM<unsigned, false>::vector m_geometry_indices;
|
||||||
ShM<unsigned, false>::vector m_geometry_list;
|
ShM<unsigned, false>::vector m_geometry_list;
|
||||||
|
|
||||||
boost::thread_specific_ptr<StaticRTree<RTreeLeaf, ShM<FixedPointCoordinate, false>::vector, false>>
|
boost::thread_specific_ptr<
|
||||||
m_static_rtree;
|
StaticRTree<RTreeLeaf, ShM<FixedPointCoordinate, false>::vector, false>> m_static_rtree;
|
||||||
boost::filesystem::path ram_index_path;
|
boost::filesystem::path ram_index_path;
|
||||||
boost::filesystem::path file_index_path;
|
boost::filesystem::path file_index_path;
|
||||||
RangeTable<16, false> m_name_table;
|
RangeTable<16, false> m_name_table;
|
||||||
@ -199,8 +199,7 @@ template <class EdgeDataT> class InternalDataFacade : public BaseDataFacade<Edge
|
|||||||
BOOST_ASSERT_MSG(!m_coordinate_list->empty(), "coordinates must be loaded before r-tree");
|
BOOST_ASSERT_MSG(!m_coordinate_list->empty(), "coordinates must be loaded before r-tree");
|
||||||
|
|
||||||
m_static_rtree.reset(
|
m_static_rtree.reset(
|
||||||
new StaticRTree<RTreeLeaf>(ram_index_path, file_index_path, m_coordinate_list)
|
new StaticRTree<RTreeLeaf>(ram_index_path, file_index_path, m_coordinate_list));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadStreetNames(const boost::filesystem::path &names_file)
|
void LoadStreetNames(const boost::filesystem::path &names_file)
|
||||||
@ -307,59 +306,59 @@ template <class EdgeDataT> class InternalDataFacade : public BaseDataFacade<Edge
|
|||||||
}
|
}
|
||||||
|
|
||||||
// search graph access
|
// search graph access
|
||||||
unsigned GetNumberOfNodes() const { return m_query_graph->GetNumberOfNodes(); }
|
unsigned GetNumberOfNodes() const final { return m_query_graph->GetNumberOfNodes(); }
|
||||||
|
|
||||||
unsigned GetNumberOfEdges() const { return m_query_graph->GetNumberOfEdges(); }
|
unsigned GetNumberOfEdges() const final { return m_query_graph->GetNumberOfEdges(); }
|
||||||
|
|
||||||
unsigned GetOutDegree(const NodeID n) const { return m_query_graph->GetOutDegree(n); }
|
unsigned GetOutDegree(const NodeID n) const final { return m_query_graph->GetOutDegree(n); }
|
||||||
|
|
||||||
NodeID GetTarget(const EdgeID e) const { return m_query_graph->GetTarget(e); }
|
NodeID GetTarget(const EdgeID e) const final { return m_query_graph->GetTarget(e); }
|
||||||
|
|
||||||
EdgeDataT &GetEdgeData(const EdgeID e) { return m_query_graph->GetEdgeData(e); }
|
// EdgeDataT &GetEdgeData(const EdgeID e) final { return m_query_graph->GetEdgeData(e); }
|
||||||
|
|
||||||
const EdgeDataT &GetEdgeData(const EdgeID e) const { return m_query_graph->GetEdgeData(e); }
|
EdgeDataT &GetEdgeData(const EdgeID e) const final { return m_query_graph->GetEdgeData(e); }
|
||||||
|
|
||||||
EdgeID BeginEdges(const NodeID n) const { return m_query_graph->BeginEdges(n); }
|
EdgeID BeginEdges(const NodeID n) const final { return m_query_graph->BeginEdges(n); }
|
||||||
|
|
||||||
EdgeID EndEdges(const NodeID n) const { return m_query_graph->EndEdges(n); }
|
EdgeID EndEdges(const NodeID n) const final { return m_query_graph->EndEdges(n); }
|
||||||
|
|
||||||
EdgeRange GetAdjacentEdgeRange(const NodeID node) const
|
EdgeRange GetAdjacentEdgeRange(const NodeID node) const final
|
||||||
{
|
{
|
||||||
return m_query_graph->GetAdjacentEdgeRange(node);
|
return m_query_graph->GetAdjacentEdgeRange(node);
|
||||||
};
|
};
|
||||||
|
|
||||||
// searches for a specific edge
|
// searches for a specific edge
|
||||||
EdgeID FindEdge(const NodeID from, const NodeID to) const
|
EdgeID FindEdge(const NodeID from, const NodeID to) const final
|
||||||
{
|
{
|
||||||
return m_query_graph->FindEdge(from, to);
|
return m_query_graph->FindEdge(from, to);
|
||||||
}
|
}
|
||||||
|
|
||||||
EdgeID FindEdgeInEitherDirection(const NodeID from, const NodeID to) const
|
EdgeID FindEdgeInEitherDirection(const NodeID from, const NodeID to) const final
|
||||||
{
|
{
|
||||||
return m_query_graph->FindEdgeInEitherDirection(from, to);
|
return m_query_graph->FindEdgeInEitherDirection(from, to);
|
||||||
}
|
}
|
||||||
|
|
||||||
EdgeID FindEdgeIndicateIfReverse(const NodeID from, const NodeID to, bool &result) const
|
EdgeID FindEdgeIndicateIfReverse(const NodeID from, const NodeID to, bool &result) const final
|
||||||
{
|
{
|
||||||
return m_query_graph->FindEdgeIndicateIfReverse(from, to, result);
|
return m_query_graph->FindEdgeIndicateIfReverse(from, to, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
// node and edge information access
|
// node and edge information access
|
||||||
FixedPointCoordinate GetCoordinateOfNode(const unsigned id) const
|
FixedPointCoordinate GetCoordinateOfNode(const unsigned id) const final
|
||||||
{
|
{
|
||||||
return m_coordinate_list->at(id);
|
return m_coordinate_list->at(id);
|
||||||
};
|
};
|
||||||
|
|
||||||
bool EdgeIsCompressed(const unsigned id) const { return m_egde_is_compressed.at(id); }
|
bool EdgeIsCompressed(const unsigned id) const { return m_egde_is_compressed.at(id); }
|
||||||
|
|
||||||
TurnInstruction GetTurnInstructionForEdgeID(const unsigned id) const
|
TurnInstruction GetTurnInstructionForEdgeID(const unsigned id) const final
|
||||||
{
|
{
|
||||||
return m_turn_instruction_list.at(id);
|
return m_turn_instruction_list.at(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LocateClosestEndPointForCoordinate(const FixedPointCoordinate &input_coordinate,
|
bool LocateClosestEndPointForCoordinate(const FixedPointCoordinate &input_coordinate,
|
||||||
FixedPointCoordinate &result,
|
FixedPointCoordinate &result,
|
||||||
const unsigned zoom_level = 18)
|
const unsigned zoom_level = 18) final
|
||||||
{
|
{
|
||||||
if (!m_static_rtree.get())
|
if (!m_static_rtree.get())
|
||||||
{
|
{
|
||||||
@ -372,7 +371,7 @@ template <class EdgeDataT> class InternalDataFacade : public BaseDataFacade<Edge
|
|||||||
|
|
||||||
bool FindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate,
|
bool FindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate,
|
||||||
PhantomNode &resulting_phantom_node,
|
PhantomNode &resulting_phantom_node,
|
||||||
const unsigned zoom_level)
|
const unsigned zoom_level) final
|
||||||
{
|
{
|
||||||
if (!m_static_rtree.get())
|
if (!m_static_rtree.get())
|
||||||
{
|
{
|
||||||
@ -387,7 +386,7 @@ template <class EdgeDataT> class InternalDataFacade : public BaseDataFacade<Edge
|
|||||||
IncrementalFindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate,
|
IncrementalFindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate,
|
||||||
std::vector<PhantomNode> &resulting_phantom_node_vector,
|
std::vector<PhantomNode> &resulting_phantom_node_vector,
|
||||||
const unsigned zoom_level,
|
const unsigned zoom_level,
|
||||||
const unsigned number_of_results)
|
const unsigned number_of_results) final
|
||||||
{
|
{
|
||||||
if (!m_static_rtree.get())
|
if (!m_static_rtree.get())
|
||||||
{
|
{
|
||||||
@ -398,14 +397,14 @@ template <class EdgeDataT> class InternalDataFacade : public BaseDataFacade<Edge
|
|||||||
input_coordinate, resulting_phantom_node_vector, zoom_level, number_of_results);
|
input_coordinate, resulting_phantom_node_vector, zoom_level, number_of_results);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned GetCheckSum() const { return m_check_sum; }
|
unsigned GetCheckSum() const final { return m_check_sum; }
|
||||||
|
|
||||||
unsigned GetNameIndexFromEdgeID(const unsigned id) const
|
unsigned GetNameIndexFromEdgeID(const unsigned id) const final
|
||||||
{
|
{
|
||||||
return m_name_ID_list.at(id);
|
return m_name_ID_list.at(id);
|
||||||
};
|
};
|
||||||
|
|
||||||
void GetName(const unsigned name_id, std::string &result) const
|
void GetName(const unsigned name_id, std::string &result) const final
|
||||||
{
|
{
|
||||||
if (UINT_MAX == name_id)
|
if (UINT_MAX == name_id)
|
||||||
{
|
{
|
||||||
@ -424,13 +423,13 @@ template <class EdgeDataT> class InternalDataFacade : public BaseDataFacade<Edge
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual unsigned GetGeometryIndexForEdgeID(const unsigned id) const
|
virtual unsigned GetGeometryIndexForEdgeID(const unsigned id) const final
|
||||||
{
|
{
|
||||||
return m_via_node_list.at(id);
|
return m_via_node_list.at(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void GetUncompressedGeometry(const unsigned id, std::vector<unsigned> &result_nodes)
|
virtual void GetUncompressedGeometry(const unsigned id,
|
||||||
const
|
std::vector<unsigned> &result_nodes) const final
|
||||||
{
|
{
|
||||||
const unsigned begin = m_geometry_indices.at(id);
|
const unsigned begin = m_geometry_indices.at(id);
|
||||||
const unsigned end = m_geometry_indices.at(id + 1);
|
const unsigned end = m_geometry_indices.at(id + 1);
|
||||||
@ -440,7 +439,7 @@ template <class EdgeDataT> class InternalDataFacade : public BaseDataFacade<Edge
|
|||||||
result_nodes.begin(), m_geometry_list.begin() + begin, m_geometry_list.begin() + end);
|
result_nodes.begin(), m_geometry_list.begin() + begin, m_geometry_list.begin() + end);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string GetTimestamp() const { return m_timestamp; }
|
std::string GetTimestamp() const final { return m_timestamp; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INTERNAL_DATA_FACADE
|
#endif // INTERNAL_DATA_FACADE
|
||||||
|
@ -83,8 +83,8 @@ template <class EdgeDataT> class SharedDataFacade : public BaseDataFacade<EdgeDa
|
|||||||
ShM<unsigned, true>::vector m_geometry_indices;
|
ShM<unsigned, true>::vector m_geometry_indices;
|
||||||
ShM<unsigned, true>::vector m_geometry_list;
|
ShM<unsigned, true>::vector m_geometry_list;
|
||||||
|
|
||||||
boost::thread_specific_ptr<StaticRTree<RTreeLeaf, ShM<FixedPointCoordinate, true>::vector, true>>
|
boost::thread_specific_ptr<
|
||||||
m_static_rtree;
|
StaticRTree<RTreeLeaf, ShM<FixedPointCoordinate, true>::vector, true>> m_static_rtree;
|
||||||
boost::filesystem::path file_index_path;
|
boost::filesystem::path file_index_path;
|
||||||
|
|
||||||
std::shared_ptr<RangeTable<16, true>> m_name_table;
|
std::shared_ptr<RangeTable<16, true>> m_name_table;
|
||||||
@ -117,8 +117,7 @@ template <class EdgeDataT> class SharedDataFacade : public BaseDataFacade<EdgeDa
|
|||||||
tree_ptr,
|
tree_ptr,
|
||||||
data_layout->num_entries[SharedDataLayout::R_SEARCH_TREE],
|
data_layout->num_entries[SharedDataLayout::R_SEARCH_TREE],
|
||||||
file_index_path,
|
file_index_path,
|
||||||
m_coordinate_list)
|
m_coordinate_list));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadGraph()
|
void LoadGraph()
|
||||||
@ -280,55 +279,54 @@ template <class EdgeDataT> class SharedDataFacade : public BaseDataFacade<EdgeDa
|
|||||||
}
|
}
|
||||||
|
|
||||||
// search graph access
|
// search graph access
|
||||||
unsigned GetNumberOfNodes() const { return m_query_graph->GetNumberOfNodes(); }
|
unsigned GetNumberOfNodes() const final { return m_query_graph->GetNumberOfNodes(); }
|
||||||
|
|
||||||
unsigned GetNumberOfEdges() const { return m_query_graph->GetNumberOfEdges(); }
|
unsigned GetNumberOfEdges() const final { return m_query_graph->GetNumberOfEdges(); }
|
||||||
|
|
||||||
unsigned GetOutDegree(const NodeID n) const { return m_query_graph->GetOutDegree(n); }
|
unsigned GetOutDegree(const NodeID n) const final { return m_query_graph->GetOutDegree(n); }
|
||||||
|
|
||||||
NodeID GetTarget(const EdgeID e) const { return m_query_graph->GetTarget(e); }
|
NodeID GetTarget(const EdgeID e) const final { return m_query_graph->GetTarget(e); }
|
||||||
|
|
||||||
EdgeDataT &GetEdgeData(const EdgeID e) { return m_query_graph->GetEdgeData(e); }
|
EdgeDataT &GetEdgeData(const EdgeID e) const final { return m_query_graph->GetEdgeData(e); }
|
||||||
|
|
||||||
// const EdgeDataT &GetEdgeData( const EdgeID e ) const {
|
EdgeID BeginEdges(const NodeID n) const final { return m_query_graph->BeginEdges(n); }
|
||||||
// return m_query_graph->GetEdgeData(e);
|
|
||||||
// }
|
|
||||||
|
|
||||||
EdgeID BeginEdges(const NodeID n) const { return m_query_graph->BeginEdges(n); }
|
EdgeID EndEdges(const NodeID n) const final { return m_query_graph->EndEdges(n); }
|
||||||
|
|
||||||
EdgeID EndEdges(const NodeID n) const { return m_query_graph->EndEdges(n); }
|
EdgeRange GetAdjacentEdgeRange(const NodeID node) const final
|
||||||
|
|
||||||
EdgeRange GetAdjacentEdgeRange(const NodeID node) const
|
|
||||||
{
|
{
|
||||||
return m_query_graph->GetAdjacentEdgeRange(node);
|
return m_query_graph->GetAdjacentEdgeRange(node);
|
||||||
};
|
};
|
||||||
|
|
||||||
// searches for a specific edge
|
// searches for a specific edge
|
||||||
EdgeID FindEdge(const NodeID from, const NodeID to) const
|
EdgeID FindEdge(const NodeID from, const NodeID to) const final
|
||||||
{
|
{
|
||||||
return m_query_graph->FindEdge(from, to);
|
return m_query_graph->FindEdge(from, to);
|
||||||
}
|
}
|
||||||
|
|
||||||
EdgeID FindEdgeInEitherDirection(const NodeID from, const NodeID to) const
|
EdgeID FindEdgeInEitherDirection(const NodeID from, const NodeID to) const final
|
||||||
{
|
{
|
||||||
return m_query_graph->FindEdgeInEitherDirection(from, to);
|
return m_query_graph->FindEdgeInEitherDirection(from, to);
|
||||||
}
|
}
|
||||||
|
|
||||||
EdgeID FindEdgeIndicateIfReverse(const NodeID from, const NodeID to, bool &result) const
|
EdgeID FindEdgeIndicateIfReverse(const NodeID from, const NodeID to, bool &result) const final
|
||||||
{
|
{
|
||||||
return m_query_graph->FindEdgeIndicateIfReverse(from, to, result);
|
return m_query_graph->FindEdgeIndicateIfReverse(from, to, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
// node and edge information access
|
// node and edge information access
|
||||||
FixedPointCoordinate GetCoordinateOfNode(const NodeID id) const
|
FixedPointCoordinate GetCoordinateOfNode(const NodeID id) const final
|
||||||
{
|
{
|
||||||
return m_coordinate_list->at(id);
|
return m_coordinate_list->at(id);
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual bool EdgeIsCompressed(const unsigned id) const { return m_egde_is_compressed.at(id); }
|
virtual bool EdgeIsCompressed(const unsigned id) const final
|
||||||
|
{
|
||||||
|
return m_egde_is_compressed.at(id);
|
||||||
|
}
|
||||||
|
|
||||||
virtual void GetUncompressedGeometry(const unsigned id, std::vector<unsigned> &result_nodes)
|
virtual void GetUncompressedGeometry(const unsigned id,
|
||||||
const
|
std::vector<unsigned> &result_nodes) const final
|
||||||
{
|
{
|
||||||
const unsigned begin = m_geometry_indices.at(id);
|
const unsigned begin = m_geometry_indices.at(id);
|
||||||
const unsigned end = m_geometry_indices.at(id + 1);
|
const unsigned end = m_geometry_indices.at(id + 1);
|
||||||
@ -338,19 +336,19 @@ template <class EdgeDataT> class SharedDataFacade : public BaseDataFacade<EdgeDa
|
|||||||
result_nodes.begin(), m_geometry_list.begin() + begin, m_geometry_list.begin() + end);
|
result_nodes.begin(), m_geometry_list.begin() + begin, m_geometry_list.begin() + end);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual unsigned GetGeometryIndexForEdgeID(const unsigned id) const
|
virtual unsigned GetGeometryIndexForEdgeID(const unsigned id) const final
|
||||||
{
|
{
|
||||||
return m_via_node_list.at(id);
|
return m_via_node_list.at(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
TurnInstruction GetTurnInstructionForEdgeID(const unsigned id) const
|
TurnInstruction GetTurnInstructionForEdgeID(const unsigned id) const final
|
||||||
{
|
{
|
||||||
return m_turn_instruction_list.at(id);
|
return m_turn_instruction_list.at(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LocateClosestEndPointForCoordinate(const FixedPointCoordinate &input_coordinate,
|
bool LocateClosestEndPointForCoordinate(const FixedPointCoordinate &input_coordinate,
|
||||||
FixedPointCoordinate &result,
|
FixedPointCoordinate &result,
|
||||||
const unsigned zoom_level = 18)
|
const unsigned zoom_level = 18) final
|
||||||
{
|
{
|
||||||
if (!m_static_rtree.get())
|
if (!m_static_rtree.get())
|
||||||
{
|
{
|
||||||
@ -363,7 +361,7 @@ template <class EdgeDataT> class SharedDataFacade : public BaseDataFacade<EdgeDa
|
|||||||
|
|
||||||
bool FindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate,
|
bool FindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate,
|
||||||
PhantomNode &resulting_phantom_node,
|
PhantomNode &resulting_phantom_node,
|
||||||
const unsigned zoom_level)
|
const unsigned zoom_level) final
|
||||||
{
|
{
|
||||||
if (!m_static_rtree.get())
|
if (!m_static_rtree.get())
|
||||||
{
|
{
|
||||||
@ -378,7 +376,7 @@ template <class EdgeDataT> class SharedDataFacade : public BaseDataFacade<EdgeDa
|
|||||||
IncrementalFindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate,
|
IncrementalFindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate,
|
||||||
std::vector<PhantomNode> &resulting_phantom_node_vector,
|
std::vector<PhantomNode> &resulting_phantom_node_vector,
|
||||||
const unsigned zoom_level,
|
const unsigned zoom_level,
|
||||||
const unsigned number_of_results)
|
const unsigned number_of_results) final
|
||||||
{
|
{
|
||||||
if (!m_static_rtree.get())
|
if (!m_static_rtree.get())
|
||||||
{
|
{
|
||||||
@ -389,14 +387,14 @@ template <class EdgeDataT> class SharedDataFacade : public BaseDataFacade<EdgeDa
|
|||||||
input_coordinate, resulting_phantom_node_vector, zoom_level, number_of_results);
|
input_coordinate, resulting_phantom_node_vector, zoom_level, number_of_results);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned GetCheckSum() const { return m_check_sum; }
|
unsigned GetCheckSum() const final { return m_check_sum; }
|
||||||
|
|
||||||
unsigned GetNameIndexFromEdgeID(const unsigned id) const
|
unsigned GetNameIndexFromEdgeID(const unsigned id) const final
|
||||||
{
|
{
|
||||||
return m_name_ID_list.at(id);
|
return m_name_ID_list.at(id);
|
||||||
};
|
};
|
||||||
|
|
||||||
void GetName(const unsigned name_id, std::string &result) const
|
void GetName(const unsigned name_id, std::string &result) const final
|
||||||
{
|
{
|
||||||
if (UINT_MAX == name_id)
|
if (UINT_MAX == name_id)
|
||||||
{
|
{
|
||||||
@ -415,7 +413,7 @@ template <class EdgeDataT> class SharedDataFacade : public BaseDataFacade<EdgeDa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string GetTimestamp() const { return m_timestamp; }
|
std::string GetTimestamp() const final { return m_timestamp; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SHARED_DATA_FACADE_H
|
#endif // SHARED_DATA_FACADE_H
|
||||||
|
Loading…
Reference in New Issue
Block a user