Commit Graph

116 Commits

Author SHA1 Message Date
Patrick Niklaus
78ac3cffde Add max values for viaroute and trip and reorganize return code handling
"status" is now always:
 - 200 if the request was successful
 - 207 if the result is empty (no path found)
 - 400 if the request is invalid

 viaroute and trip now have a maximum of 500 and 100 locations
 respectively. Override with the --max-viaroute-size and --max-trip-size
 parameters.
2015-12-17 04:14:34 +01:00
Patrick Niklaus
9a332d2f86 Fix osrm.hpp placement 2015-12-15 19:25:26 +01:00
Patrick Niklaus
6daa3290d4 Cleanup library setup 2015-12-14 22:00:20 +01:00
Daniel J. Hofmann
1dfa2d6e91 Catch bad_alloc and provide human reasable error messages 2015-10-19 18:18:11 +02:00
Daniel J. Hofmann
78283a0e0e Check if memory locking should be done before locking unconditionally 2015-10-19 16:23:18 +02:00
Daniel J. Hofmann
993321e971 Lock by default, set fail on error 2015-10-19 16:23:18 +02:00
Daniel J. Hofmann
f7a1e2f652 Flatten routed by using functional try-catch blocks 2015-10-19 16:23:18 +02:00
Daniel J. Hofmann
e75be68466 Only lock the virtual address space when shared memory was requested
In addition, some improvements:

- unlock only when locking succeeded
- scoped exception safe RAII locker

Reference:

- https://github.com/Project-OSRM/osrm-backend/issues/1698#issuecomment-144003177
2015-10-19 16:23:18 +02:00
Daniel J. Hofmann
809bdb7c1f Fixes version generation, no longer derives version on git tags.
We were stuck on the 4.5.0 tag from develop, since we searched for the
latest tag, but release tags are done on the master branch.

This commit rips out all the code for deriving the version on git tags.

Instead, we define major, minor, and patch versions in the CMakeLists
and then pass it on to:

- the `libosrm.pc` `pkg-config` file

- a `version.hpp` header that makes use of the preprocessor's string
  concatenation to provide an easy way for generating version string
  literals such as "v4.8.0".

That is, in the source code please now use the following defines:

    #define OSRM_VERSION_MAJOR "@OSRM_VERSION_MAJOR@"
    #define OSRM_VERSION_MINOR "@OSRM_VERSION_MINOR@"
    #define OSRM_VERSION_PATCH "@OSRM_VERSION_PATCH@"

    #define OSRM_VERSION "v" OSRM_VERSION_MAJOR "." OSRM_VERSION_MINOR "." OSRM_VERSION_PATCH
2015-09-30 18:22:25 +02:00
Daniel J. Hofmann
62b20769ee Modernize the code base to C++11 standards and beyond.
Apply `clang-modernize` (based on Clang 3.6) transformations to the
codebase while making sure to support Clang>=3.4 and GCC>=4.8.

We apply the transformations in parallel to speed up the quite
time consuming process, and use our `clang-format` style file
to automatically format the code respecting our coding conventions.

We use the following self-explanatory transformations:

* AddOverride
* LoopConvert
* PassByValue
* ReplaceAutoPtr
* UseAuto
* UseNullptr

This required a `compile_commands.json` compilation database, e.g.

    ccmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=1

for CMake or check Bear for a Makefile based solution (or even Ninja).

    git ls-files -x '*.cpp|*.h' | \
      xargs -I{} -P $(nproc) clang-modernize -p build -final-syntax-check -format -style=file -summary -for-compilers=clang-3.4,gcc-4.8 -include . -exclude third_party {}

Boom!

References:

* http://clang.llvm.org/extra/clang-modernize.html
* http://clang.llvm.org/extra/ModernizerUsage.html
2015-08-18 12:56:34 +02:00
Patrick Niklaus
8f3feac916 Ensure routed is backwards compatible 2015-04-22 09:49:08 +02:00
Patrick Niklaus
d8d46e0f3e Add routed parameter to limit matching size 2015-03-03 00:48:57 +01:00
Dennis Luxen
3bd27ae8c5 change copyright line from personal names to project 2015-02-19 09:19:51 +01:00
Dennis Luxen
b20b7e65bf renamed: Util/* -> util/* 2015-01-27 17:47:23 +01:00
Dennis Luxen
0de6e4ccbb renamed: Util/DataStoreOptions.h -> Util/datastore_options.hpp
renamed:    Util/ProgramOptions.h -> Util/routed_options.hpp
2015-01-27 17:06:10 +01:00
Dennis Luxen
1187f83ffd renamed: Library/*.h -> library/*.hpp 2015-01-27 16:35:19 +01:00
Dennis Luxen
9672f00ec3 renamed: Server/*/*.h -> server/*/*.hpp 2015-01-27 12:35:29 +01:00
Dennis Luxen
baacd0e50c reformat source files 2015-01-22 12:24:54 +01:00
Dennis Luxen
c6bb7c5993 renamed: Include/osrm/ServerConfig.h -> Include/osrm/libosrm_config.hpp
pass lib config object by reference
2015-01-08 15:05:54 +01:00
Frédéric Rodrigo
598f5519d1 Remove setters from structures server_config 2015-01-06 14:11:09 +00:00
Frédéric Rodrigo
ced64d7a09 Move server configuration from method parameter to a struct 2015-01-06 14:11:09 +00:00
Frédéric Rodrigo
e2605c2838 Add a commande line option to osrm-routed for max locations supported in distance table query 2015-01-06 14:11:09 +00:00
Dennis Luxen
2caeb4008c renamed: Util/GitDescription.cpp.in -> Util/git_sha.cpp.in
renamed:    Util/GitDescription.h -> Util/git_sha.h
2015-01-05 14:32:04 +01:00
Dennis Luxen
b095aae5ce some minor include untangling 2014-10-21 19:05:56 +02:00
Dennis Luxen
cb5575ae89 remove compile-time time stamps, rely on git SHA instead, fixes #1229 2014-10-17 10:57:00 +02:00
Dennis Luxen
274140d309 refactor SimpleLogger into simple_logger compile unit 2014-10-10 19:32:49 +02:00
Dennis Luxen
b9e1d3116c implements and fixes #997
- ServerPaths object can be populated by passing base path to OSRM
- reduces code/functionality duplication in node-OSRM
2014-10-10 10:41:05 +02:00
Dennis Luxen
8f8cb6a52f keep server instance in a unique_ptr 2014-08-20 11:24:29 +02:00
Dennis Luxen
9aeb28066d fix inverted logic 2014-08-07 19:19:21 +02:00
Dennis Luxen
85f6ab869e Revert "let ServerFactory return unique ptr instead of raw ptr"
This reverts commit cc7c6b9ece.
2014-07-28 14:08:54 +02:00
Dennis Luxen
cc7c6b9ece let ServerFactory return unique ptr instead of raw ptr 2014-07-28 10:15:22 +02:00
alex85k
42d3ee9b94 workaround for std::packaged_task<void()> problem on MSVC 2014-06-11 18:38:00 +06:00
alex85k
7335e0809a Globally rename UUID to FingerPrint 2014-06-05 10:31:19 +02:00
Dennis Luxen
c6a07acd90 use std::packaged_task and std::future to simulate boost:🧵:timed_join() 2014-05-13 10:03:37 +02:00
Dennis Luxen
c924b2067c refactor and migrate root directory 2014-05-08 19:40:29 +02:00
Dennis Luxen
c1e7ba7118 replace all timing by C++11's chrono 2014-05-07 10:39:34 +02:00
Dennis Luxen
0167dfc3c9 shorten line 2014-04-28 12:54:11 +02:00
Dennis Luxen
02dc3dee04 shorten line 2014-04-28 12:52:55 +02:00
Dennis Luxen
a5d3bc9578 make function call more legible 2014-04-28 12:52:06 +02:00
Dennis Luxen
cfbc6b0441 remove useless parantheses 2014-04-28 12:50:44 +02:00
Dennis Luxen
0eed39cdf1 rebase branch onto develop 2014-04-24 18:13:50 +02:00
Dennis Luxen
c71c8b0047 Unpacking of intermediate paths 2014-04-24 12:03:19 +02:00
Dennis Luxen
aae3637e0c implements #958 2014-03-25 14:54:52 +01:00
Emil Tin
0b655ea6a1 trial option 2014-03-22 00:16:45 +01:00
Dennis Luxen
8bd5f69e04 fixes #958, activates 2 additional tests 2014-03-20 13:19:36 +01:00
Dennis Luxen
c470ea9fa1 lock to RAM on Linux only after options are parsed 2014-03-20 09:53:05 +01:00
Dennis Luxen
2e4ff30103 fix parameter regression when using shared memory 2014-03-18 10:51:36 +01:00
Dennis Luxen
8c4c1a56fd reduce compile time by using fwd decls 2013-12-16 11:29:38 +01:00
Dennis Luxen
758027e2e0 untangling includes to cut down compile time 2013-12-13 18:49:05 -05:00
Dennis Luxen
4ec79d61d0 Merge branch 'shared_memory' into develop 2013-10-30 15:10:07 +01:00