MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / Engine

Method Engine

src/nodejs/node_osrm.cpp:86–101  ·  view source on GitHub ↗

clang-format off * The `OSRM` method is the main constructor for creating an OSRM instance. * An OSRM instance requires a `.osrm.*` dataset(`.osrm.*` because it contains several files), which is prepared by the OSRM toolchain. * You can create such a `.osrm.*` dataset by running the OSRM binaries we ship in `node_modules/osrm/lib/binding_napi_v8/` and default * profiles (e.g. for setting speeds

Source from the content-addressed store, hash-verified

84 */
85// clang-format on
86Engine::Engine(const Napi::CallbackInfo &info) : Napi::ObjectWrap<Engine>(info)
87{
88
89 try
90 {
91 auto config = argumentsToEngineConfig(info);
92 if (!config)
93 return;
94
95 this_ = std::make_shared<osrm::OSRM>(*config);
96 }
97 catch (const std::exception &ex)
98 {
99 ThrowTypeError(info.Env(), ex.what());
100 }
101}
102
103template <typename ParameterParser, typename ServiceMemFn>
104inline void async(const Napi::CallbackInfo &info,

Callers

nothing calls this directly

Calls 3

argumentsToEngineConfigFunction · 0.85
ThrowTypeErrorFunction · 0.85
whatMethod · 0.80

Tested by

no test coverage detected