Plugin grammar skeletons
This commit is contained in:
		
							parent
							
								
									7e1c164937
								
							
						
					
					
						commit
						8eee4c23cc
					
				
							
								
								
									
										41
									
								
								include/server/api/match_parameter_grammar.hpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								include/server/api/match_parameter_grammar.hpp
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,41 @@ | ||||
| #ifndef MATCH_PARAMETERS_GRAMMAR_HPP | ||||
| #define MATCH_PARAMETERS_GRAMMAR_HPP | ||||
| 
 | ||||
| #include "engine/api/match_parameters.hpp" | ||||
| 
 | ||||
| #include "server/api/base_parameters_grammar.hpp" | ||||
| 
 | ||||
| #include <boost/spirit/include/qi_lit.hpp> | ||||
| #include <boost/spirit/include/qi_uint.hpp> | ||||
| #include <boost/spirit/include/qi_grammar.hpp> | ||||
| #include <boost/spirit/include/qi_action.hpp> | ||||
| #include <boost/spirit/include/qi_optional.hpp> | ||||
| 
 | ||||
| namespace osrm | ||||
| { | ||||
| namespace server | ||||
| { | ||||
| namespace api | ||||
| { | ||||
| 
 | ||||
| namespace qi = boost::spirit::qi; | ||||
| 
 | ||||
| struct MatchParametersGrammar final : public BaseParametersGrammar | ||||
| { | ||||
|     using Iterator = std::string::iterator; | ||||
| 
 | ||||
|     MatchParametersGrammar() : BaseParametersGrammar(root_rule, parameters) | ||||
|     { | ||||
|         root_rule = "TODO(daniel-j-h)"; | ||||
|     } | ||||
| 
 | ||||
|     engine::api::MatchParameters parameters; | ||||
| 
 | ||||
|   private: | ||||
|     qi::rule<Iterator> root_rule, match_rule; | ||||
| }; | ||||
| } | ||||
| } | ||||
| } | ||||
| 
 | ||||
| #endif | ||||
							
								
								
									
										41
									
								
								include/server/api/nearest_parameter_grammar.hpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								include/server/api/nearest_parameter_grammar.hpp
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,41 @@ | ||||
| #ifndef NEAREST_PARAMETERS_GRAMMAR_HPP | ||||
| #define NEAREST_PARAMETERS_GRAMMAR_HPP | ||||
| 
 | ||||
| #include "engine/api/nearest_parameters.hpp" | ||||
| 
 | ||||
| #include "server/api/base_parameters_grammar.hpp" | ||||
| 
 | ||||
| #include <boost/spirit/include/qi_lit.hpp> | ||||
| #include <boost/spirit/include/qi_uint.hpp> | ||||
| #include <boost/spirit/include/qi_grammar.hpp> | ||||
| #include <boost/spirit/include/qi_action.hpp> | ||||
| #include <boost/spirit/include/qi_optional.hpp> | ||||
| 
 | ||||
| namespace osrm | ||||
| { | ||||
| namespace server | ||||
| { | ||||
| namespace api | ||||
| { | ||||
| 
 | ||||
| namespace qi = boost::spirit::qi; | ||||
| 
 | ||||
| struct NearestParametersGrammar final : public BaseParametersGrammar | ||||
| { | ||||
|     using Iterator = std::string::iterator; | ||||
| 
 | ||||
|     NearestParametersGrammar() : BaseParametersGrammar(root_rule, parameters) | ||||
|     { | ||||
|         root_rule = "TODO(daniel-j-h)"; | ||||
|     } | ||||
| 
 | ||||
|     engine::api::NearestParameters parameters; | ||||
| 
 | ||||
|   private: | ||||
|     qi::rule<Iterator> root_rule, nearest_rule; | ||||
| }; | ||||
| } | ||||
| } | ||||
| } | ||||
| 
 | ||||
| #endif | ||||
| @ -19,6 +19,7 @@ namespace api | ||||
| { | ||||
| 
 | ||||
| namespace qi = boost::spirit::qi; | ||||
| 
 | ||||
| struct RouteParametersGrammar : public BaseParametersGrammar | ||||
| { | ||||
|     using Iterator = std::string::iterator; | ||||
| @ -28,8 +29,7 @@ struct RouteParametersGrammar : public BaseParametersGrammar | ||||
|     using OverviewT = engine::api::RouteParameters::OverviewType; | ||||
|     using UturnsT = std::vector<boost::optional<bool>>; | ||||
| 
 | ||||
|     RouteParametersGrammar() | ||||
|         : BaseParametersGrammar(root_rule, parameters) | ||||
|     RouteParametersGrammar() : BaseParametersGrammar(root_rule, parameters) | ||||
|     { | ||||
|         const auto set_geojson_type = [this]() | ||||
|         { | ||||
| @ -79,6 +79,7 @@ struct RouteParametersGrammar : public BaseParametersGrammar | ||||
|     } | ||||
| 
 | ||||
|     engine::api::RouteParameters parameters; | ||||
| 
 | ||||
|   private: | ||||
|     qi::rule<Iterator> root_rule, route_rule, geometries_rule, overview_rule; | ||||
|     qi::rule<Iterator, UturnsT()> uturns_rule; | ||||
|  | ||||
| @ -19,7 +19,8 @@ namespace api | ||||
| { | ||||
| 
 | ||||
| namespace qi = boost::spirit::qi; | ||||
| struct TableParametersGrammar : public BaseParametersGrammar | ||||
| 
 | ||||
| struct TableParametersGrammar final : public BaseParametersGrammar | ||||
| { | ||||
|     using Iterator = std::string::iterator; | ||||
|     using SourcesT = std::vector<std::size_t>; | ||||
|  | ||||
							
								
								
									
										41
									
								
								include/server/api/trip_parameter_grammar.hpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								include/server/api/trip_parameter_grammar.hpp
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,41 @@ | ||||
| #ifndef TRIP_PARAMETERS_GRAMMAR_HPP | ||||
| #define TRIP_PARAMETERS_GRAMMAR_HPP | ||||
| 
 | ||||
| #include "engine/api/trip_parameters.hpp" | ||||
| 
 | ||||
| #include "server/api/base_parameters_grammar.hpp" | ||||
| 
 | ||||
| #include <boost/spirit/include/qi_lit.hpp> | ||||
| #include <boost/spirit/include/qi_uint.hpp> | ||||
| #include <boost/spirit/include/qi_grammar.hpp> | ||||
| #include <boost/spirit/include/qi_action.hpp> | ||||
| #include <boost/spirit/include/qi_optional.hpp> | ||||
| 
 | ||||
| namespace osrm | ||||
| { | ||||
| namespace server | ||||
| { | ||||
| namespace api | ||||
| { | ||||
| 
 | ||||
| namespace qi = boost::spirit::qi; | ||||
| 
 | ||||
| struct TripParametersGrammar final : public BaseParametersGrammar | ||||
| { | ||||
|     using Iterator = std::string::iterator; | ||||
| 
 | ||||
|     TripParametersGrammar() : BaseParametersGrammar(root_rule, parameters) | ||||
|     { | ||||
|         root_rule = "TODO(daniel-j-h)"; | ||||
|     } | ||||
| 
 | ||||
|     engine::api::TripParameters parameters; | ||||
| 
 | ||||
|   private: | ||||
|     qi::rule<Iterator> root_rule, trip_rule; | ||||
| }; | ||||
| } | ||||
| } | ||||
| } | ||||
| 
 | ||||
| #endif | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user