Refactor osrm-extract and osrm-contract to use osrm lib interface

Simplifies implementation of the tools slightly.
Ensures osrm::extract and osrm::contract keep working.

Follows up PR #3787
This commit is contained in:
Mateusz Łoskot 2017-05-10 17:13:30 +02:00 committed by Patrick Niklaus
parent a5bfcd876f
commit e2b7e8a4da
2 changed files with 8 additions and 13 deletions

View File

@ -1,7 +1,6 @@
#include "contractor/contractor.hpp"
#include "contractor/contractor_config.hpp"
#include "extractor/profile_properties.hpp"
#include "storage/io.hpp"
#include "osrm/contractor.hpp"
#include "osrm/contractor_config.hpp"
#include "util/log.hpp"
#include "util/version.hpp"
@ -170,12 +169,12 @@ int main(int argc, char *argv[]) try
tbb::task_scheduler_init init(contractor_config.requested_num_threads);
auto exitcode = contractor::Contractor(contractor_config).Run();
osrm::contract(contractor_config);
util::DumpSTXXLStats();
util::DumpMemoryStats();
return exitcode;
return EXIT_SUCCESS;
}
catch (const std::bad_alloc &e)
{

View File

@ -1,6 +1,5 @@
#include "extractor/extractor.hpp"
#include "extractor/extractor_config.hpp"
#include "extractor/scripting_environment_lua.hpp"
#include "osrm/extractor.hpp"
#include "osrm/extractor_config.hpp"
#include "util/log.hpp"
#include "util/version.hpp"
@ -156,15 +155,12 @@ int main(int argc, char *argv[]) try
return EXIT_FAILURE;
}
// setup scripting environment
extractor::Sol2ScriptingEnvironment scripting_environment(
extractor_config.profile_path.string().c_str());
auto exitcode = extractor::Extractor(extractor_config).run(scripting_environment);
osrm::extract(extractor_config);
util::DumpSTXXLStats();
util::DumpMemoryStats();
return exitcode;
return EXIT_SUCCESS;
}
catch (const std::bad_alloc &e)
{