From 67fae1d1f03fdfb93a796e46dfc1c0a6da1021f9 Mon Sep 17 00:00:00 2001 From: Pepijn Schoen Date: Fri, 5 May 2017 10:23:09 +0200 Subject: [PATCH] rename osrm_input_path to osrm_path, clang-format --- include/contractor/contractor_config.hpp | 2 +- include/customizer/customizer_config.hpp | 4 +- include/extractor/extraction_containers.hpp | 2 +- include/extractor/extractor_config.hpp | 2 +- include/storage/io_config.hpp | 69 ++++++++++----------- src/extractor/extraction_containers.cpp | 5 +- src/extractor/extractor.cpp | 8 +-- src/tools/contract.cpp | 8 +-- src/tools/customize.cpp | 6 +- src/tools/partition.cpp | 2 +- src/updater/updater.cpp | 2 +- 11 files changed, 52 insertions(+), 58 deletions(-) diff --git a/include/contractor/contractor_config.hpp b/include/contractor/contractor_config.hpp index 6def873c9..37fa822ea 100644 --- a/include/contractor/contractor_config.hpp +++ b/include/contractor/contractor_config.hpp @@ -52,7 +52,7 @@ struct ContractorConfig final : storage::IOConfig void UseDefaultOutputNames() { IOConfig::UseDefaultOutputNames(); - updater_config.osrm_input_path = osrm_input_path; + updater_config.osrm_path = osrm_path; updater_config.UseDefaultOutputNames(); } diff --git a/include/customizer/customizer_config.hpp b/include/customizer/customizer_config.hpp index 2922f1c0f..5641232b6 100644 --- a/include/customizer/customizer_config.hpp +++ b/include/customizer/customizer_config.hpp @@ -6,8 +6,8 @@ #include #include -#include "updater/updater_config.hpp" #include "storage/io_config.hpp" +#include "updater/updater_config.hpp" namespace osrm { @@ -21,7 +21,7 @@ struct CustomizationConfig final : storage::IOConfig void UseDefaultOutputNames() { IOConfig::UseDefaultOutputNames(); - updater_config.osrm_input_path = osrm_input_path; + updater_config.osrm_path = osrm_path; updater_config.UseDefaultOutputNames(); } diff --git a/include/extractor/extraction_containers.hpp b/include/extractor/extraction_containers.hpp index 38e06a179..ec2b630e3 100644 --- a/include/extractor/extraction_containers.hpp +++ b/include/extractor/extraction_containers.hpp @@ -57,7 +57,7 @@ class ExtractionContainers ExtractionContainers(); void PrepareData(ScriptingEnvironment &scripting_environment, - const std::string &osrm_input_path, + const std::string &osrm_path, const std::string &restrictions_file_name, const std::string &names_data_path); }; diff --git a/include/extractor/extractor_config.hpp b/include/extractor/extractor_config.hpp index 1581befe3..dc3a174f2 100644 --- a/include/extractor/extractor_config.hpp +++ b/include/extractor/extractor_config.hpp @@ -61,7 +61,7 @@ struct ExtractorConfig final : storage::IOConfig } } - osrm_input_path = basepath + ".osrm"; + osrm_path = basepath + ".osrm"; IOConfig::UseDefaultOutputNames(); } diff --git a/include/storage/io_config.hpp b/include/storage/io_config.hpp index e83e98576..ece13f50b 100644 --- a/include/storage/io_config.hpp +++ b/include/storage/io_config.hpp @@ -1,5 +1,5 @@ -#ifndef IO_CONFIG_HPP -#define IO_CONFIG_HPP +#ifndef OSRM_IO_CONFIG_HPP +#define OSRM_IO_CONFIG_HPP #include @@ -11,45 +11,42 @@ struct IOConfig { IOConfig() = default; - IOConfig(const boost::filesystem::path &base) : osrm_input_path(base) - { - UseDefaultOutputNames(); - } + IOConfig(const boost::filesystem::path &base) : osrm_path(base) { UseDefaultOutputNames(); } // Infer the output names from the path of the .osrm file void UseDefaultOutputNames() { - ram_index_path = {osrm_input_path.string() + ".ramIndex"}; - file_index_path = {osrm_input_path.string() + ".fileIndex"}; - hsgr_data_path = {osrm_input_path.string() + ".hsgr"}; - nodes_data_path = {osrm_input_path.string() + ".nodes"}; - edges_data_path = {osrm_input_path.string() + ".edges"}; - core_data_path = {osrm_input_path.string() + ".core"}; - geometries_path = {osrm_input_path.string() + ".geometry"}; - timestamp_path = {osrm_input_path.string() + ".timestamp"}; - turn_weight_penalties_path = {osrm_input_path.string() + ".turn_weight_penalties"}; - turn_duration_penalties_path = {osrm_input_path.string() + ".turn_duration_penalties"}; - turn_penalties_index_path = {osrm_input_path.string() + ".turn_penalties_index"}; - datasource_names_path = {osrm_input_path.string() + ".datasource_names"}; - names_data_path = {osrm_input_path.string() + ".names"}; - properties_path = {osrm_input_path.string() + ".properties"}; - intersection_class_path = {osrm_input_path.string() + ".icd"}; - turn_lane_data_path = {osrm_input_path.string() + ".tld"}; - turn_lane_description_path = {osrm_input_path.string() + ".tls"}; - mld_partition_path = {osrm_input_path.string() + ".partition"}; - mld_storage_path = {osrm_input_path.string() + ".cells"}; - mld_graph_path = {osrm_input_path.string() + ".mldgr"}; - level_path = {osrm_input_path.string() + ".level"}; - node_path = {osrm_input_path.string() + ".enw"}; - edge_based_nodes_data_path = {osrm_input_path.string() + ".nodes_data"}; - edge_based_graph_path = {osrm_input_path.string() + ".ebg"}; - compressed_node_based_graph_path = {osrm_input_path.string() + ".cnbg"}; - cnbg_ebg_mapping_path = {osrm_input_path.string() + ".cnbg_to_ebg"}; - restriction_path = {osrm_input_path.string() + ".restrictions"}; - intersection_class_data_path = {osrm_input_path.string() + ".icd"}; + ram_index_path = {osrm_path.string() + ".ramIndex"}; + file_index_path = {osrm_path.string() + ".fileIndex"}; + hsgr_data_path = {osrm_path.string() + ".hsgr"}; + nodes_data_path = {osrm_path.string() + ".nodes"}; + edges_data_path = {osrm_path.string() + ".edges"}; + core_data_path = {osrm_path.string() + ".core"}; + geometries_path = {osrm_path.string() + ".geometry"}; + timestamp_path = {osrm_path.string() + ".timestamp"}; + turn_weight_penalties_path = {osrm_path.string() + ".turn_weight_penalties"}; + turn_duration_penalties_path = {osrm_path.string() + ".turn_duration_penalties"}; + turn_penalties_index_path = {osrm_path.string() + ".turn_penalties_index"}; + datasource_names_path = {osrm_path.string() + ".datasource_names"}; + names_data_path = {osrm_path.string() + ".names"}; + properties_path = {osrm_path.string() + ".properties"}; + intersection_class_path = {osrm_path.string() + ".icd"}; + turn_lane_data_path = {osrm_path.string() + ".tld"}; + turn_lane_description_path = {osrm_path.string() + ".tls"}; + mld_partition_path = {osrm_path.string() + ".partition"}; + mld_storage_path = {osrm_path.string() + ".cells"}; + mld_graph_path = {osrm_path.string() + ".mldgr"}; + level_path = {osrm_path.string() + ".level"}; + node_path = {osrm_path.string() + ".enw"}; + edge_based_nodes_data_path = {osrm_path.string() + ".nodes_data"}; + edge_based_graph_path = {osrm_path.string() + ".ebg"}; + compressed_node_based_graph_path = {osrm_path.string() + ".cnbg"}; + cnbg_ebg_mapping_path = {osrm_path.string() + ".cnbg_to_ebg"}; + restriction_path = {osrm_path.string() + ".restrictions"}; + intersection_class_data_path = {osrm_path.string() + ".icd"}; } - boost::filesystem::path osrm_input_path; + boost::filesystem::path osrm_path; boost::filesystem::path ram_index_path; boost::filesystem::path file_index_path; @@ -80,8 +77,6 @@ struct IOConfig boost::filesystem::path cnbg_ebg_mapping_path; boost::filesystem::path restriction_path; boost::filesystem::path intersection_class_data_path; - - }; } } diff --git a/src/extractor/extraction_containers.cpp b/src/extractor/extraction_containers.cpp index 83cf58fde..a7588f2d0 100644 --- a/src/extractor/extraction_containers.cpp +++ b/src/extractor/extraction_containers.cpp @@ -125,12 +125,11 @@ ExtractionContainers::ExtractionContainers() * */ void ExtractionContainers::PrepareData(ScriptingEnvironment &scripting_environment, - const std::string &osrm_input_path, + const std::string &osrm_path, const std::string &restrictions_file_name, const std::string &name_file_name) { - storage::io::FileWriter file_out(osrm_input_path, - storage::io::FileWriter::GenerateFingerprint); + storage::io::FileWriter file_out(osrm_path, storage::io::FileWriter::GenerateFingerprint); PrepareNodes(); WriteNodes(file_out); diff --git a/src/extractor/extractor.cpp b/src/extractor/extractor.cpp index 86db43d58..45c4c265b 100644 --- a/src/extractor/extractor.cpp +++ b/src/extractor/extractor.cpp @@ -240,7 +240,7 @@ Extractor::ParseOSMData(ScriptingEnvironment &scripting_environment, util::Log() << "timestamp: " << timestamp; extraction_containers.PrepareData(scripting_environment, - config.osrm_input_path.string(), + config.osrm_path.string(), config.restriction_path.string(), config.names_data_path.string()); @@ -339,7 +339,7 @@ Extractor::ParseOSMData(ScriptingEnvironment &scripting_environment, auto profile_properties = scripting_environment.GetProfileProperties(); SetClassNames(classes_map, profile_properties); - files::writeProfileProperties(config.profile_properties_output_path, profile_properties); + files::writeProfileProperties(config.profile_properties_path, profile_properties); TIMER_STOP(extracting); util::Log() << "extraction finished after " << TIMER_SEC(extracting) << "s"; @@ -414,7 +414,7 @@ Extractor::LoadNodeBasedGraph(std::unordered_set &barriers, std::vector &coordiantes, extractor::PackedOSMIDs &osm_node_ids) { - storage::io::FileReader file_reader(config.osrm_input_path, + storage::io::FileReader file_reader(config.osrm_path, storage::io::FileReader::VerifyFingerprint); auto barriers_iter = inserter(barriers, end(barriers)); @@ -431,7 +431,7 @@ Extractor::LoadNodeBasedGraph(std::unordered_set &barriers, if (edge_list.empty()) { - throw util::exception("Node-based-graph (" + config.osrm_input_path.string() + + throw util::exception("Node-based-graph (" + config.osrm_path.string() + ") contains no edges." + SOURCE_REF); } diff --git a/src/tools/contract.cpp b/src/tools/contract.cpp index 13cbd63dd..773b0dbf9 100644 --- a/src/tools/contract.cpp +++ b/src/tools/contract.cpp @@ -79,7 +79,7 @@ return_code parseArguments(int argc, char *argv[], contractor::ContractorConfig boost::program_options::options_description hidden_options("Hidden options"); hidden_options.add_options()( "input,i", - boost::program_options::value(&contractor_config.osrm_input_path), + boost::program_options::value(&contractor_config.osrm_path), "Input file in .osm, .osm.bz2 or .osm.pbf format"); // positional option @@ -169,14 +169,14 @@ int main(int argc, char *argv[]) try << "! This setting may have performance side-effects."; } - if (!boost::filesystem::is_regular_file(contractor_config.osrm_input_path)) + if (!boost::filesystem::is_regular_file(contractor_config.osrm_path)) { - util::Log(logERROR) << "Input file " << contractor_config.osrm_input_path.string() + util::Log(logERROR) << "Input file " << contractor_config.osrm_path.string() << " not found!"; return EXIT_FAILURE; } - util::Log() << "Input file: " << contractor_config.osrm_input_path.filename().string(); + util::Log() << "Input file: " << contractor_config.osrm_path.filename().string(); util::Log() << "Threads: " << contractor_config.requested_num_threads; tbb::task_scheduler_init init(contractor_config.requested_num_threads); diff --git a/src/tools/customize.cpp b/src/tools/customize.cpp index 6452066a0..5327a4669 100644 --- a/src/tools/customize.cpp +++ b/src/tools/customize.cpp @@ -72,7 +72,7 @@ parseArguments(int argc, char *argv[], customizer::CustomizationConfig &customiz boost::program_options::options_description hidden_options("Hidden options"); hidden_options.add_options()( "input,i", - boost::program_options::value(&customization_config.osrm_input_path), + boost::program_options::value(&customization_config.osrm_path), "Input file in .osrm format"); // positional option @@ -153,9 +153,9 @@ int main(int argc, char *argv[]) try return EXIT_FAILURE; } - if (!boost::filesystem::is_regular_file(customization_config.osrm_input_path)) + if (!boost::filesystem::is_regular_file(customization_config.osrm_path)) { - util::Log(logERROR) << "Input file " << customization_config.osrm_input_path.string() + util::Log(logERROR) << "Input file " << customization_config.osrm_path.string() << " not found!"; return EXIT_FAILURE; } diff --git a/src/tools/partition.cpp b/src/tools/partition.cpp index 22140c0d9..7054d7be5 100644 --- a/src/tools/partition.cpp +++ b/src/tools/partition.cpp @@ -114,7 +114,7 @@ return_code parseArguments(int argc, char *argv[], partition::PartitionConfig &c boost::program_options::options_description hidden_options("Hidden options"); hidden_options.add_options()( "input,i", - boost::program_options::value(&config.osrm_input_path), + boost::program_options::value(&config.osrm_path), "Input file in .osrm format"); // positional option diff --git a/src/updater/updater.cpp b/src/updater/updater.cpp index 6639ae6b5..d09182c23 100644 --- a/src/updater/updater.cpp +++ b/src/updater/updater.cpp @@ -108,7 +108,7 @@ void checkWeightsConsistency( extractor::files::readSegmentData(config.geometries_path, segment_data); extractor::EdgeBasedNodeDataContainer node_data; - extractor::files::readNodeData(config.osrm_input_path.string() + ".ebg_nodes", node_data); + extractor::files::readNodeData(config.osrm_path.string() + ".ebg_nodes", node_data); extractor::TurnDataContainer turn_data; extractor::files::readTurnData(config.edges_data_path, turn_data);