To fix #2193 prefix_length member variable has been added to ParsedURL that is set to the length of "/service/version/profile/" prefix when the prefix is accepted by the parser. Also BOOST_FUSION_ADAPT_STRUCT for osrm::server::api::ParsedURL has been moved from header to url_parser.cpp to speed up compilation of CUs that do not use the fusion adaption.
		
			
				
	
	
		
			40 lines
		
	
	
		
			719 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			719 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #ifndef SERVER_SERVICE_BASE_SERVICE_HPP
 | |
| #define SERVER_SERVICE_BASE_SERVICE_HPP
 | |
| 
 | |
| #include "engine/status.hpp"
 | |
| #include "util/coordinate.hpp"
 | |
| #include "osrm/osrm.hpp"
 | |
| 
 | |
| #include <variant/variant.hpp>
 | |
| 
 | |
| #include <string>
 | |
| #include <vector>
 | |
| 
 | |
| namespace osrm
 | |
| {
 | |
| namespace server
 | |
| {
 | |
| namespace service
 | |
| {
 | |
| 
 | |
| class BaseService
 | |
| {
 | |
|   public:
 | |
|     using ResultT = mapbox::util::variant<util::json::Object, std::string>;
 | |
| 
 | |
|     BaseService(OSRM &routing_machine) : routing_machine(routing_machine) {}
 | |
|     virtual ~BaseService() = default;
 | |
| 
 | |
|     virtual engine::Status RunQuery(std::size_t prefix_length, std::string &query, ResultT &result) = 0;
 | |
| 
 | |
|     virtual unsigned GetVersion() = 0;
 | |
| 
 | |
|   protected:
 | |
|     OSRM &routing_machine;
 | |
| };
 | |
| }
 | |
| }
 | |
| }
 | |
| 
 | |
| #endif
 |