add parameter to choose algorithm for tsp calculation and remove redundant code
This commit is contained in:
committed by
Huyen Chau Nguyen
parent
b15f8f68e4
commit
6191b6bee2
@@ -42,7 +42,7 @@ template <typename Iterator, class HandlerT> struct APIGrammar : qi::grammar<Ite
|
||||
*(query) >> -(uturns);
|
||||
query = ('?') >> (+(zoom | output | jsonp | checksum | location | hint | timestamp | u | cmp |
|
||||
language | instruction | geometry | alt_route | old_API | num_results |
|
||||
matching_beta | gps_precision | classify | locs));
|
||||
matching_beta | gps_precision | classify | tsp_algo | locs));
|
||||
|
||||
zoom = (-qi::lit('&')) >> qi::lit('z') >> '=' >>
|
||||
qi::short_[boost::bind(&HandlerT::setZoomLevel, handler, ::_1)];
|
||||
@@ -85,6 +85,8 @@ template <typename Iterator, class HandlerT> struct APIGrammar : qi::grammar<Ite
|
||||
qi::bool_[boost::bind(&HandlerT::setClassify, handler, ::_1)];
|
||||
locs = (-qi::lit('&')) >> qi::lit("locs") >> '=' >>
|
||||
stringforPolyline[boost::bind(&HandlerT::getCoordinatesFromGeometry, handler, ::_1)];
|
||||
tsp_algo = (-qi::lit('&')) >> qi::lit("tsp_algo") >> '=' >>
|
||||
string[boost::bind(&HandlerT::setTSPAlgo, handler, ::_1)];
|
||||
|
||||
string = +(qi::char_("a-zA-Z"));
|
||||
stringwithDot = +(qi::char_("a-zA-Z0-9_.-"));
|
||||
@@ -96,7 +98,8 @@ template <typename Iterator, class HandlerT> struct APIGrammar : qi::grammar<Ite
|
||||
qi::rule<Iterator> api_call, query;
|
||||
qi::rule<Iterator, std::string()> service, zoom, output, string, jsonp, checksum, location,
|
||||
hint, timestamp, stringwithDot, stringwithPercent, language, instruction, geometry, cmp, alt_route, u,
|
||||
uturns, old_API, num_results, matching_beta, gps_precision, classify, locs, stringforPolyline;
|
||||
uturns, old_API, num_results, matching_beta, gps_precision, classify, locs, stringforPolyline, tsp_algo;
|
||||
uturns, old_API, num_results, matching_beta, gps_precision, classify, tsp_algo;
|
||||
|
||||
HandlerT *handler;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user