superclass customizer_config with io_config

This commit is contained in:
Pepijn Schoen
2017-04-29 11:15:18 +02:00
committed by Daniel J. H
parent a9b6686725
commit 897518a297
2 changed files with 11 additions and 34 deletions
+7 -30
View File
@@ -1,53 +1,30 @@
#ifndef OSRM_CUSTOMIZE_CUSTOMIZER_CONFIG_HPP
#define OSRM_CUSTOMIZE_CUSTOMIZER_CONFIG_HPP
#include "updater/updater_config.hpp"
#include <boost/filesystem/path.hpp>
#include <array>
#include <string>
#include "updater/updater_config.hpp"
#include "storage/io_config.hpp"
namespace osrm
{
namespace customizer
{
struct CustomizationConfig
struct CustomizationConfig final : storage::IOConfig
{
CustomizationConfig() : requested_num_threads(0) {}
void UseDefaults()
void UseDefaultOutputNames()
{
std::string basepath = base_path.string();
const std::string ext = ".osrm";
const auto pos = basepath.find(ext);
if (pos != std::string::npos)
{
basepath.replace(pos, ext.size(), "");
}
else
{
// unknown extension
}
edge_based_graph_path = basepath + ".osrm.ebg";
mld_partition_path = basepath + ".osrm.partition";
mld_storage_path = basepath + ".osrm.cells";
mld_graph_path = basepath + ".osrm.mldgr";
updater_config.osrm_input_path = basepath + ".osrm";
IOConfig::UseDefaultOutputNames();
updater_config.osrm_input_path = osrm_input_path;
updater_config.UseDefaultOutputNames();
}
// might be changed to the node based graph at some point
boost::filesystem::path base_path;
boost::filesystem::path edge_based_graph_path;
boost::filesystem::path mld_partition_path;
boost::filesystem::path mld_storage_path;
boost::filesystem::path mld_graph_path;
unsigned requested_num_threads;
updater::UpdaterConfig updater_config;