Commit Graph

106 Commits

Author SHA1 Message Date
Patrick Niklaus
8ff8dc7200 Try ulong_long, requires ifdef 2016-04-12 18:11:08 +02:00
Daniel J. Hofmann
8a2bd09fd0 Adapts all grammars to use expectation parsers without backtracking.
Sequence parsers using `>>` allow for backtracking, expectation parsers
`>` do not. This allows us to properly report the position where parsing
failed, by catching the expectation_failure exception and adapting the
iterator ourselves.

References:
- https://github.com/Project-OSRM/osrm-backend/pull/2188
- https://github.com/Project-OSRM/osrm-backend/issues/2168
- http://www.boost.org/doc/libs/1_55_0/libs/spirit/doc/html/spirit/qi/reference/operator/expect.html
2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
def89ac079 Conform to v5 spec and support "unlimited" as radiuses value.
Supersedes: https://github.com/Project-OSRM/osrm-backend/pull/2231

Thanks to Michael Krasnyk (@oxidase) for figuring out the reason for the
segfault earlier:

> https://github.com/Project-OSRM/osrm-backend/pull/2231#issuecomment-207114226
2016-04-08 21:03:50 +02:00
Michael Krasnyk
fe08726387 Fix BOOST_FUSION_ADAPT_STRUCT parameters for ParsedURL
Fix build error: macro "BOOST_FUSION_ADAPT_STRUCT" passed 5 arguments, but takes just 2
https://travis-ci.org/Project-OSRM/osrm-backend/builds/121406444
2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
9bb4a68599 Fixes grammar includes and formats them 2016-04-08 21:03:50 +02:00
Michael Krasnyk
58ebadd7b3 Fix #2173 with a no_trailing_dot_policy
no_trailing_dot_policy rejects parsing exp, exp_n, nan, inf
and rejects parsing a fractional part if detects ".Fmt".
For Fmt = 'j', 's', 'o', 'n':
 42.foo    rule parses 42.
 42.json   rule parses 42
 42..json  rule parses 42.

Reference:
- https://github.com/Project-OSRM/osrm-backend/pull/2222#issuecomment-206206239
2016-04-08 21:03:50 +02:00
Michael Krasnyk
cae06ba2c1 Fix type "osrm::server::api::ParsedURL ()" 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
0274afa0f7 Allow 4.json and 4.3.json format; needs -lit(".") >> -lit("json") hack^Wworkaround
Rainer Deyke's workaround without the need to do ugly backtracking.

References:
- http://lists.boost.org/boost-users/2016/03/85960.php
- https://github.com/Project-OSRM/osrm-backend/issues/2173#issuecomment-204342785
2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
d3dbca374d Do not modify the end iterator for parameter parsing, too 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
6f0b6a8158 Re-factor URL parser: make grammar stateless 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
b25cd6aaf2 Moving from references is a bad idea in parameter parsers, too 2016-04-08 21:03:50 +02:00
Daniel J. Hofmann
891ff7dd80 Do not modify the end iterator, make const 2016-04-08 21:03:50 +02:00
Moritz Kobitzsch
dfd180a292 fixing unit tests 2016-04-08 11:21:14 +02:00
Daniel J. Hofmann
09931d7ad8 Removes server-side support for POST requests. 2016-04-05 22:59:14 +02:00
Patrick Niklaus
e10e8910f3 Use global uturns parameter.
Instead of previously per-via settings like uturns=true;false;true;; it
now only supports a global setting uturns=true.
2016-04-05 22:58:32 +02:00
Patrick Niklaus
5f457bff12 Rename alternative -> alternatives 2016-04-05 22:58:32 +02:00
Patrick Niklaus
a8fc95d4e4 Move bearing to public namespace 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
7c30ea32bf Runs scripts/format.sh 2016-04-05 22:58:32 +02:00
Patrick Niklaus
58fb633df3 Add support for tile plugin 2016-04-05 22:58:32 +02:00
Patrick Niklaus
804816f014 Fix table parameter parsing 2016-04-05 22:58:32 +02:00
Patrick Niklaus
d9d4742130 First round of lat,lng -> lng,lat switcheroo 2016-04-05 22:58:32 +02:00
Patrick Niklaus
14c36bc405 Finish the nearest plugin 2016-04-05 22:58:32 +02:00
Patrick Niklaus
8378d95588 Add trip plugin 2016-04-05 22:58:32 +02:00
Patrick Niklaus
b34f9b1795 Hook up map matching 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
4d20dea271 Service skeletons for nearest, trip, match 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
c59647ad2f Fix grammar constraint and enable all plugin links 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
e466cbe0ce Plugin grammar skeletons 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
a24de2d22a Enforce parameter and grammar type to catch subtle bugs 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
f452a3025d Link parameters to grammars 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
3c58eaf49f Require a BaseParameters type at compile time via enable_if 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
7bec75b709 Semantic action handler requires passing optional by value and fusion::vector2 2016-04-05 22:58:32 +02:00
Patrick Niklaus
56ea24b03b Add tests for bearing parsing 2016-04-05 22:58:32 +02:00
Patrick Niklaus
277829c280 Add table service 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
c895848061 Optional<T> semantic action handler takes T argument 2016-04-05 22:58:32 +02:00
Patrick Niklaus
64e5ebb55f Fix parameter parsing tests 2016-04-05 22:58:32 +02:00
Patrick Niklaus
f3e72623e9 Add viaroute suport for new API 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
b1c84b598f Print the _local_ endpoint Boost ASIO assigns a port to, fixes #2097 2016-03-18 12:09:28 +01:00
Patrick Niklaus
0eaa393065 Limit tile zoomlevel to 12+ 2016-03-02 19:59:49 +01:00
Daniel Patterson
6d749777fc Using bind<T> in this case causes ambiguity with GCC 5.2.1 (see http://www.boost.org/doc/libs/develop/libs/bind/doc/html/bind.html#bind.faq.Q_forms). Remove template and let the type be deduced automatically. 2016-03-02 09:54:08 -08:00
Daniel J. Hofmann
aeee565115 Formats all the files we touch.. 2016-03-01 23:51:25 +01:00
Daniel Patterson
5dc7b79bb6 Implements a vector tileserver so you can see what's going on inside
OSRM.
2016-03-01 23:51:25 +01:00
Patrick Niklaus
a0b4fcc05a Remove last bits of GPX support code 2016-03-01 23:44:07 +01:00
karenzshea
f5c12ec433 comments 2016-01-29 23:49:09 +01:00
karenzshea
262cdd7bc0 move tribool obj into request_parser 2016-01-29 23:49:09 +01:00
Daniel J. Hofmann
a48f02e0da Takes care of proper special member generation globally, fixes #1689
Phew, a lot of classes were affected by this. The rationale for the
changes are as follows:

- When a type X declares any constructor, the default constructor is
  not declared, so there is no need for X() = delete there. In fact,
  there is brutal difference between those two: deleted members
  participate in overload resolution, but not-declared members do not!

- When a type X wants to be non-copyable (e.g. to be only movable, like
  threads, unique_ptrs, and so on), you can either do it by inheriting
  from boost::noncopyable (the old way), or better declare both (!) the
  copy constructor _and_ the copy assignment operator as deleted:

      X(X const&) = delete;
      X& operator=(X const&) = delete;

  We had tons of types with deleted copy constructors that were lacking
  a corresponding deleted copy assignment operator, making them still
  copyable and you wouldn't even notice (read: scary)!

References:

- http://accu.org/content/conf2014/Howard_Hinnant_Accu_2014.pdf
- http://www.boost.org/doc/libs/master/libs/core/doc/html/core/noncopyable.html

Note: I know, I'm quoting Hinnant's extraordinary slides a lot, but
getting the sematic right here is so incredibly important.
2016-01-27 17:25:30 +01:00
Patrick Niklaus
d9c281cd7c Remove boost fusion dependency in RouteParameters 2016-01-26 22:57:02 +01:00
Daniel J. Hofmann
54a9173107 Make public RouteParameters header no longer depend on Spirit
And includes the optional header that was transitively included by the
spirit header before. Hopefully this will speed up compile times, as the
RouteParameters header is used in a lot of translation units.
2016-01-26 22:57:02 +01:00
Patrick Niklaus
439eb9da3d Create public facing libraries for extractor, contractor and datastore
New libraries libosrm_extract, libosrm_contract, libosrm_store
2016-01-21 06:47:34 +01:00
Daniel J. Hofmann
e7d9e42a16 Fix race condition in osrm-routed HTTP server
We had a similar issue a few month ago. Stumbled upon this by accident.

It goes like this:

- `output_buffer` is function-local
- we pass it to async_write and leave the scope
- `output_buffers` goes out of scope
- bad things happen, sometimes

The fix is to, again, put it inside the connection that handles itself
via the enable_shared_from_this idiom.

References:

- http://www.boost.org/doc/libs/1_59_0/doc/html/boost_asio/reference/async_write/overload1.html
- https://github.com/Project-OSRM/osrm-backend/pull/1690
2016-01-13 23:21:45 +01:00
Patrick Niklaus
6991a38703 Run clang-format 2016-01-08 01:31:57 +01:00
Patrick Niklaus
6b18e4f7e9 Add namespace around all files 2016-01-08 01:30:52 +01:00
Patrick Niklaus
b209952ce0 Fix naming of methodes for RouteParameters 2016-01-05 12:06:33 +01:00
Patrick Niklaus
028ca5c9d9 Apply clang-format 2016-01-05 12:04:04 +01:00
Daniel J. Hofmann
685d330ee2 Remove license headers from project source files; global license 2016-01-04 19:06:32 +01:00
Patrick Niklaus
97585bb26a Fix include paths 2016-01-03 18:47:50 +01:00
Patrick Niklaus
bfc6c9b89d Move files in src/ include/ 2016-01-03 16:37:38 +01:00