Refactor routing plugins:
- remove superflous members from RawRouteData, partially implements #1238 - DescriptorTable moved to BaseDescriptor.h - added templated assignment c'tor to DescriptorConfig - refactored check for valid input coordinates, moved to BasePlugin.h - replaced shared_ptr's to descriptors in ViaRoutePlugin.h with unique_ptr - implemented FindIncrementalPhantomNode in facades for a single, i.e. first result - untangled a few includes
This commit is contained in:
		
							parent
							
								
									002da1e02d
								
							
						
					
					
						commit
						463511871f
					
				| @ -68,12 +68,10 @@ struct RawRouteData | |||||||
|     std::vector<std::vector<PathData>> unpacked_path_segments; |     std::vector<std::vector<PathData>> unpacked_path_segments; | ||||||
|     std::vector<PathData> unpacked_alternative; |     std::vector<PathData> unpacked_alternative; | ||||||
|     std::vector<PhantomNodes> segment_end_coordinates; |     std::vector<PhantomNodes> segment_end_coordinates; | ||||||
|     std::vector<FixedPointCoordinate> raw_via_node_coordinates; |  | ||||||
|     std::vector<bool> source_traversed_in_reverse; |     std::vector<bool> source_traversed_in_reverse; | ||||||
|     std::vector<bool> target_traversed_in_reverse; |     std::vector<bool> target_traversed_in_reverse; | ||||||
|     std::vector<bool> alt_source_traversed_in_reverse; |     std::vector<bool> alt_source_traversed_in_reverse; | ||||||
|     std::vector<bool> alt_target_traversed_in_reverse; |     std::vector<bool> alt_target_traversed_in_reverse; | ||||||
|     unsigned check_sum; |  | ||||||
|     int shortest_path_length; |     int shortest_path_length; | ||||||
|     int alternative_path_length; |     int alternative_path_length; | ||||||
| 
 | 
 | ||||||
| @ -82,8 +80,7 @@ struct RawRouteData | |||||||
|         return (leg != unpacked_path_segments.size() - 1); |         return (leg != unpacked_path_segments.size() - 1); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     RawRouteData() |     RawRouteData() : | ||||||
|         : check_sum(SPECIAL_NODEID), |  | ||||||
|           shortest_path_length(INVALID_EDGE_WEIGHT), |           shortest_path_length(INVALID_EDGE_WEIGHT), | ||||||
|           alternative_path_length(INVALID_EDGE_WEIGHT) |           alternative_path_length(INVALID_EDGE_WEIGHT) | ||||||
|     { |     { | ||||||
|  | |||||||
| @ -35,13 +35,35 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||||||
| #include <osrm/Reply.h> | #include <osrm/Reply.h> | ||||||
| 
 | 
 | ||||||
| #include <string> | #include <string> | ||||||
|  | #include <unordered_map> | ||||||
| #include <vector> | #include <vector> | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|  | struct DescriptorTable : public std::unordered_map<std::string, unsigned> | ||||||
|  | { | ||||||
|  |     unsigned get_id(const std::string &key) | ||||||
|  |     { | ||||||
|  |         auto iter = find(key); | ||||||
|  |         if (iter != end())  | ||||||
|  |         { | ||||||
|  |             return iter->second; | ||||||
|  |         }  | ||||||
|  |         return 0; | ||||||
|  |     } | ||||||
|  | }; | ||||||
|  |   | ||||||
|  | 
 | ||||||
| struct DescriptorConfig | struct DescriptorConfig | ||||||
| { | { | ||||||
|     DescriptorConfig() : instructions(true), geometry(true), encode_geometry(true), zoom_level(18) |     DescriptorConfig() : instructions(true), geometry(true), encode_geometry(true), zoom_level(18) | ||||||
|     { |     { | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     template<class OtherT> | ||||||
|  |     DescriptorConfig(const OtherT &other) : instructions(other.print_instructions),  | ||||||
|  |                                             geometry(other.geometry),  | ||||||
|  |                                             encode_geometry(other.compression),  | ||||||
|  |                                             zoom_level(other.zoom_level) { } | ||||||
|     bool instructions; |     bool instructions; | ||||||
|     bool geometry; |     bool geometry; | ||||||
|     bool encode_geometry; |     bool encode_geometry; | ||||||
|  | |||||||
| @ -278,7 +278,7 @@ template <class DataFacadeT> class JSONDescriptor final : public BaseDescriptor< | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         JSON::Object json_hint_object; |         JSON::Object json_hint_object; | ||||||
|         json_hint_object.values["checksum"] = raw_route.check_sum; |         json_hint_object.values["checksum"] = facade->GetCheckSum(); | ||||||
|         JSON::Array json_location_hint_array; |         JSON::Array json_location_hint_array; | ||||||
|         std::string hint; |         std::string hint; | ||||||
|         for (const auto i : osrm::irange<std::size_t>(0, raw_route.segment_end_coordinates.size())) |         for (const auto i : osrm::irange<std::size_t>(0, raw_route.segment_end_coordinates.size())) | ||||||
|  | |||||||
| @ -34,6 +34,7 @@ namespace boost { namespace interprocess { class named_mutex; } } | |||||||
| #include <osrm/RouteParameters.h> | #include <osrm/RouteParameters.h> | ||||||
| #include <osrm/ServerPaths.h> | #include <osrm/ServerPaths.h> | ||||||
| 
 | 
 | ||||||
|  | #include "../DataStructures/QueryEdge.h" | ||||||
| #include "../Plugins/BasePlugin.h" | #include "../Plugins/BasePlugin.h" | ||||||
| #include "../Plugins/DistanceTablePlugin.h" | #include "../Plugins/DistanceTablePlugin.h" | ||||||
| #include "../Plugins/HelloWorldPlugin.h" | #include "../Plugins/HelloWorldPlugin.h" | ||||||
|  | |||||||
| @ -28,8 +28,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||||||
| #ifndef BASEPLUGIN_H_ | #ifndef BASEPLUGIN_H_ | ||||||
| #define BASEPLUGIN_H_ | #define BASEPLUGIN_H_ | ||||||
| 
 | 
 | ||||||
| #include "../Util/StringUtil.h" |  | ||||||
| 
 |  | ||||||
| #include <osrm/Coordinate.h> | #include <osrm/Coordinate.h> | ||||||
| #include <osrm/Reply.h> | #include <osrm/Reply.h> | ||||||
| #include <osrm/RouteParameters.h> | #include <osrm/RouteParameters.h> | ||||||
| @ -45,6 +43,20 @@ class BasePlugin | |||||||
|     virtual ~BasePlugin() {} |     virtual ~BasePlugin() {} | ||||||
|     virtual const std::string GetDescriptor() const = 0; |     virtual const std::string GetDescriptor() const = 0; | ||||||
|     virtual void HandleRequest(const RouteParameters &routeParameters, http::Reply &reply) = 0; |     virtual void HandleRequest(const RouteParameters &routeParameters, http::Reply &reply) = 0; | ||||||
|  |     virtual bool check_all_coordinates(const std::vector<FixedPointCoordinate> coordinates) const final | ||||||
|  |     { | ||||||
|  |         if (2 > coordinates.size() ||  | ||||||
|  |             std::any_of(std::begin(coordinates), | ||||||
|  |                         std::end(coordinates), | ||||||
|  |                         [](const FixedPointCoordinate &coordinate) | ||||||
|  |                         { | ||||||
|  |                 return !coordinate.isValid(); | ||||||
|  |             })) | ||||||
|  |         { | ||||||
|  |             return false; | ||||||
|  |         } | ||||||
|  |         return true; | ||||||
|  |     } | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| #endif /* BASEPLUGIN_H_ */ | #endif /* BASEPLUGIN_H_ */ | ||||||
|  | |||||||
| @ -64,37 +64,17 @@ template <class DataFacadeT> class DistanceTablePlugin final : public BasePlugin | |||||||
| 
 | 
 | ||||||
|     void HandleRequest(const RouteParameters &route_parameters, http::Reply &reply) final |     void HandleRequest(const RouteParameters &route_parameters, http::Reply &reply) final | ||||||
|     { |     { | ||||||
|         // check number of parameters
 |         if (!check_all_coordinates(route_parameters.coordinates)) | ||||||
|         if (2 > route_parameters.coordinates.size()) |  | ||||||
|         { |         { | ||||||
|             reply = http::Reply::StockReply(http::Reply::badRequest); |             reply = http::Reply::StockReply(http::Reply::badRequest); | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         RawRouteData raw_route; |         const bool checksum_OK = (route_parameters.check_sum == facade->GetCheckSum()); | ||||||
|         raw_route.check_sum = facade->GetCheckSum(); |  | ||||||
| 
 |  | ||||||
|         if (std::any_of(begin(route_parameters.coordinates), |  | ||||||
|                         end(route_parameters.coordinates), |  | ||||||
|                         [&](FixedPointCoordinate coordinate) |  | ||||||
|                         { |  | ||||||
|                 return !coordinate.isValid(); |  | ||||||
|             })) |  | ||||||
|         { |  | ||||||
|             reply = http::Reply::StockReply(http::Reply::badRequest); |  | ||||||
|             return; |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         for (const FixedPointCoordinate &coordinate : route_parameters.coordinates) |  | ||||||
|         { |  | ||||||
|             raw_route.raw_via_node_coordinates.emplace_back(std::move(coordinate)); |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         const bool checksum_OK = (route_parameters.check_sum == raw_route.check_sum); |  | ||||||
|         unsigned max_locations = |         unsigned max_locations = | ||||||
|             std::min(100u, static_cast<unsigned>(raw_route.raw_via_node_coordinates.size())); |             std::min(100u, static_cast<unsigned>(route_parameters.coordinates.size())); | ||||||
|         PhantomNodeArray phantom_node_vector(max_locations); |         PhantomNodeArray phantom_node_vector(max_locations); | ||||||
|         for (unsigned i = 0; i < max_locations; ++i) |         for (const auto i : osrm::irange(1u, max_locations)) | ||||||
|         { |         { | ||||||
|             if (checksum_OK && i < route_parameters.hints.size() && |             if (checksum_OK && i < route_parameters.hints.size() && | ||||||
|                 !route_parameters.hints[i].empty()) |                 !route_parameters.hints[i].empty()) | ||||||
| @ -107,7 +87,7 @@ template <class DataFacadeT> class DistanceTablePlugin final : public BasePlugin | |||||||
|                     continue; |                     continue; | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|             facade->IncrementalFindPhantomNodeForCoordinate(raw_route.raw_via_node_coordinates[i], |             facade->IncrementalFindPhantomNodeForCoordinate(route_parameters.coordinates[i], | ||||||
|                                                             phantom_node_vector[i], |                                                             phantom_node_vector[i], | ||||||
|                                                             route_parameters.zoom_level, |                                                             route_parameters.zoom_level, | ||||||
|                                                             1); |                                                             1); | ||||||
|  | |||||||
| @ -31,29 +31,28 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||||||
| #include "BasePlugin.h" | #include "BasePlugin.h" | ||||||
| 
 | 
 | ||||||
| #include "../Algorithms/ObjectToBase64.h" | #include "../Algorithms/ObjectToBase64.h" | ||||||
| #include "../DataStructures/QueryEdge.h" | #include "../DataStructures/Range.h" | ||||||
| #include "../DataStructures/SearchEngine.h" | #include "../DataStructures/SearchEngine.h" | ||||||
| #include "../Descriptors/BaseDescriptor.h" | #include "../Descriptors/BaseDescriptor.h" | ||||||
| #include "../Descriptors/GPXDescriptor.h" | #include "../Descriptors/GPXDescriptor.h" | ||||||
| #include "../Descriptors/JSONDescriptor.h" | #include "../Descriptors/JSONDescriptor.h" | ||||||
| #include "../Util/make_unique.hpp" | #include "../Util/make_unique.hpp" | ||||||
| #include "../Util/simple_logger.hpp" | #include "../Util/simple_logger.hpp" | ||||||
| #include "../Util/StringUtil.h" |  | ||||||
| #include "../Util/TimingUtil.h" |  | ||||||
| 
 | 
 | ||||||
| #include <cstdlib> | #include <cstdlib> | ||||||
| 
 | 
 | ||||||
| #include <algorithm> | #include <algorithm> | ||||||
| #include <memory> | #include <memory> | ||||||
| #include <unordered_map> |  | ||||||
| #include <string> | #include <string> | ||||||
| #include <vector> | #include <vector> | ||||||
| 
 | 
 | ||||||
| template <class DataFacadeT> class ViaRoutePlugin final : public BasePlugin | template <class DataFacadeT> class ViaRoutePlugin final : public BasePlugin | ||||||
| { | { | ||||||
|   private: |   private: | ||||||
|     std::unordered_map<std::string, unsigned> descriptor_table; |     DescriptorTable descriptor_table; | ||||||
|  |     std::string descriptor_string; | ||||||
|     std::unique_ptr<SearchEngine<DataFacadeT>> search_engine_ptr; |     std::unique_ptr<SearchEngine<DataFacadeT>> search_engine_ptr; | ||||||
|  |     DataFacadeT *facade; | ||||||
| 
 | 
 | ||||||
|   public: |   public: | ||||||
|     explicit ViaRoutePlugin(DataFacadeT *facade) : descriptor_string("viaroute"), facade(facade) |     explicit ViaRoutePlugin(DataFacadeT *facade) : descriptor_string("viaroute"), facade(facade) | ||||||
| @ -71,30 +70,17 @@ template <class DataFacadeT> class ViaRoutePlugin final : public BasePlugin | |||||||
| 
 | 
 | ||||||
|     void HandleRequest(const RouteParameters &route_parameters, http::Reply &reply) final |     void HandleRequest(const RouteParameters &route_parameters, http::Reply &reply) final | ||||||
|     { |     { | ||||||
|         // check number of parameters
 |         if (!check_all_coordinates(route_parameters.coordinates)) | ||||||
|         if (2 > route_parameters.coordinates.size() || |  | ||||||
|             std::any_of(begin(route_parameters.coordinates), |  | ||||||
|                         end(route_parameters.coordinates), |  | ||||||
|                         [&](FixedPointCoordinate coordinate) |  | ||||||
|                         { |  | ||||||
|                 return !coordinate.isValid(); |  | ||||||
|             })) |  | ||||||
|         { |         { | ||||||
|             reply = http::Reply::StockReply(http::Reply::badRequest); |             reply = http::Reply::StockReply(http::Reply::badRequest); | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|  |         reply.status = http::Reply::ok; | ||||||
| 
 | 
 | ||||||
|         RawRouteData raw_route; |         std::vector<PhantomNode> phantom_node_vector(route_parameters.coordinates.size()); | ||||||
|         raw_route.check_sum = facade->GetCheckSum(); |         const bool checksum_OK = (route_parameters.check_sum == facade->GetCheckSum()); | ||||||
|         for (const FixedPointCoordinate &coordinate : route_parameters.coordinates) |  | ||||||
|         { |  | ||||||
|             raw_route.raw_via_node_coordinates.emplace_back(coordinate); |  | ||||||
|         } |  | ||||||
| 
 | 
 | ||||||
|         std::vector<PhantomNode> phantom_node_vector(raw_route.raw_via_node_coordinates.size()); |         for (const auto i : osrm::irange<std::size_t>(0, route_parameters.coordinates.size())) | ||||||
|         const bool checksum_OK = (route_parameters.check_sum == raw_route.check_sum); |  | ||||||
| 
 |  | ||||||
|         for (unsigned i = 0; i < raw_route.raw_via_node_coordinates.size(); ++i) |  | ||||||
|         { |         { | ||||||
|             if (checksum_OK && i < route_parameters.hints.size() && |             if (checksum_OK && i < route_parameters.hints.size() && | ||||||
|                 !route_parameters.hints[i].empty()) |                 !route_parameters.hints[i].empty()) | ||||||
| @ -105,25 +91,23 @@ template <class DataFacadeT> class ViaRoutePlugin final : public BasePlugin | |||||||
|                     continue; |                     continue; | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|             facade->FindPhantomNodeForCoordinate(raw_route.raw_via_node_coordinates[i], |             facade->IncrementalFindPhantomNodeForCoordinate(route_parameters.coordinates[i], | ||||||
|                                                  phantom_node_vector[i], |                                                             phantom_node_vector[i], | ||||||
|                                                  route_parameters.zoom_level); |                                                             route_parameters.zoom_level); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         PhantomNodes current_phantom_node_pair; |         RawRouteData raw_route; | ||||||
|         for (unsigned i = 0; i < phantom_node_vector.size() - 1; ++i) |         auto build_phantom_pairs = [&raw_route] (const PhantomNode &first, const PhantomNode &second) | ||||||
|         { |         { | ||||||
|             current_phantom_node_pair.source_phantom = phantom_node_vector[i]; |             raw_route.segment_end_coordinates.emplace_back(PhantomNodes{first, second}); | ||||||
|             current_phantom_node_pair.target_phantom = phantom_node_vector[i + 1]; |         }; | ||||||
|             raw_route.segment_end_coordinates.emplace_back(current_phantom_node_pair); |         osrm::for_each_pair(phantom_node_vector, build_phantom_pairs); | ||||||
|         } |  | ||||||
| 
 | 
 | ||||||
|         const bool is_alternate_requested = route_parameters.alternate_route; |         if (route_parameters.alternate_route &&  | ||||||
|         const bool is_only_one_segment = (1 == raw_route.segment_end_coordinates.size()); |             1 == raw_route.segment_end_coordinates.size()) | ||||||
|         if (is_alternate_requested && is_only_one_segment) |  | ||||||
|         { |         { | ||||||
|             search_engine_ptr->alternative_path(raw_route.segment_end_coordinates.front(), |             search_engine_ptr->alternative_path( | ||||||
|                                                 raw_route); |                 raw_route.segment_end_coordinates.front(), raw_route); | ||||||
|         } |         } | ||||||
|         else |         else | ||||||
|         { |         { | ||||||
| @ -135,42 +119,24 @@ template <class DataFacadeT> class ViaRoutePlugin final : public BasePlugin | |||||||
|         { |         { | ||||||
|             SimpleLogger().Write(logDEBUG) << "Error occurred, single path not found"; |             SimpleLogger().Write(logDEBUG) << "Error occurred, single path not found"; | ||||||
|         } |         } | ||||||
|         reply.status = http::Reply::ok; |  | ||||||
| 
 | 
 | ||||||
|         DescriptorConfig descriptor_config; |         std::unique_ptr<BaseDescriptor<DataFacadeT>> descriptor; | ||||||
| 
 |         switch (descriptor_table.get_id(route_parameters.output_format)) | ||||||
|         auto iter = descriptor_table.find(route_parameters.output_format); |  | ||||||
|         unsigned descriptor_type = (iter != descriptor_table.end() ? iter->second : 0); |  | ||||||
| 
 |  | ||||||
|         descriptor_config.zoom_level = route_parameters.zoom_level; |  | ||||||
|         descriptor_config.instructions = route_parameters.print_instructions; |  | ||||||
|         descriptor_config.geometry = route_parameters.geometry; |  | ||||||
|         descriptor_config.encode_geometry = route_parameters.compression; |  | ||||||
| 
 |  | ||||||
|         std::shared_ptr<BaseDescriptor<DataFacadeT>> descriptor; |  | ||||||
|         switch (descriptor_type) |  | ||||||
|         { |         { | ||||||
|         // case 0:
 |  | ||||||
|         //     descriptor = std::make_shared<JSONDescriptor<DataFacadeT>>();
 |  | ||||||
|         //     break;
 |  | ||||||
|         case 1: |         case 1: | ||||||
|             descriptor = std::make_shared<GPXDescriptor<DataFacadeT>>(facade); |             descriptor = osrm::make_unique<GPXDescriptor<DataFacadeT>>(facade); | ||||||
|             break; |             break; | ||||||
|         // case 2:
 |         // case 2:
 | ||||||
|         //      descriptor = std::make_shared<GEOJSONDescriptor<DataFacadeT>>();
 |         //      descriptor = osrm::make_unique<GEOJSONDescriptor<DataFacadeT>>();
 | ||||||
|         //      break;
 |         //      break;
 | ||||||
|         default: |         default: | ||||||
|             descriptor = std::make_shared<JSONDescriptor<DataFacadeT>>(facade); |             descriptor = osrm::make_unique<JSONDescriptor<DataFacadeT>>(facade); | ||||||
|             break; |             break; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         descriptor->SetConfig(descriptor_config); |         descriptor->SetConfig(route_parameters); | ||||||
|         descriptor->Run(raw_route, reply); |         descriptor->Run(raw_route, reply); | ||||||
|     } |     } | ||||||
| 
 |  | ||||||
|   private: |  | ||||||
|     std::string descriptor_string; |  | ||||||
|     DataFacadeT *facade; |  | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| #endif // VIA_ROUTE_PLUGIN_H
 | #endif // VIA_ROUTE_PLUGIN_H
 | ||||||
|  | |||||||
| @ -108,6 +108,11 @@ template <class EdgeDataT> class BaseDataFacade | |||||||
|                                             const unsigned zoom_level, |                                             const unsigned zoom_level, | ||||||
|                                             const unsigned number_of_results) = 0; |                                             const unsigned number_of_results) = 0; | ||||||
| 
 | 
 | ||||||
|  |     virtual bool | ||||||
|  |     IncrementalFindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate, | ||||||
|  |                                             PhantomNode &resulting_phantom_node, | ||||||
|  |                                             const unsigned zoom_leve) = 0; | ||||||
|  | 
 | ||||||
|     virtual unsigned GetCheckSum() const = 0; |     virtual unsigned GetCheckSum() const = 0; | ||||||
| 
 | 
 | ||||||
|     virtual unsigned GetNameIndexFromEdgeID(const unsigned id) const = 0; |     virtual unsigned GetNameIndexFromEdgeID(const unsigned id) const = 0; | ||||||
|  | |||||||
| @ -390,6 +390,24 @@ template <class EdgeDataT> class InternalDataFacade : public BaseDataFacade<Edge | |||||||
|             input_coordinate, resulting_phantom_node, zoom_level); |             input_coordinate, resulting_phantom_node, zoom_level); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     bool | ||||||
|  |     IncrementalFindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate, | ||||||
|  |                                             PhantomNode &resulting_phantom_node, | ||||||
|  |                                             const unsigned zoom_level) final | ||||||
|  |     { | ||||||
|  |         std::vector<PhantomNode> resulting_phantom_node_vector; | ||||||
|  |         auto result = IncrementalFindPhantomNodeForCoordinate(input_coordinate,  | ||||||
|  |                                                               resulting_phantom_node_vector,  | ||||||
|  |                                                               zoom_level,  | ||||||
|  |                                                               1); | ||||||
|  |         if (result) | ||||||
|  |         { | ||||||
|  |             BOOST_ASSERT(!resulting_phantom_node_vector.empty()); | ||||||
|  |             resulting_phantom_node = resulting_phantom_node_vector.front(); | ||||||
|  |         } | ||||||
|  |         return result; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     bool |     bool | ||||||
|     IncrementalFindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate, |     IncrementalFindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate, | ||||||
|                                             std::vector<PhantomNode> &resulting_phantom_node_vector, |                                             std::vector<PhantomNode> &resulting_phantom_node_vector, | ||||||
|  | |||||||
| @ -383,6 +383,24 @@ template <class EdgeDataT> class SharedDataFacade : public BaseDataFacade<EdgeDa | |||||||
|             input_coordinate, resulting_phantom_node, zoom_level); |             input_coordinate, resulting_phantom_node, zoom_level); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     bool | ||||||
|  |     IncrementalFindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate, | ||||||
|  |                                             PhantomNode &resulting_phantom_node, | ||||||
|  |                                             const unsigned zoom_level) final | ||||||
|  |     { | ||||||
|  |         std::vector<PhantomNode> resulting_phantom_node_vector; | ||||||
|  |         auto result = IncrementalFindPhantomNodeForCoordinate(input_coordinate,  | ||||||
|  |                                                               resulting_phantom_node_vector,  | ||||||
|  |                                                               zoom_level,  | ||||||
|  |                                                               1); | ||||||
|  |         if (result) | ||||||
|  |         { | ||||||
|  |             BOOST_ASSERT(!resulting_phantom_node_vector.empty()); | ||||||
|  |             resulting_phantom_node = resulting_phantom_node_vector.front(); | ||||||
|  |         } | ||||||
|  |         return result; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     bool |     bool | ||||||
|     IncrementalFindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate, |     IncrementalFindPhantomNodeForCoordinate(const FixedPointCoordinate &input_coordinate, | ||||||
|                                             std::vector<PhantomNode> &resulting_phantom_node_vector, |                                             std::vector<PhantomNode> &resulting_phantom_node_vector, | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user