From f02b7b091079af71facb72db4f3c3578cdc3464e Mon Sep 17 00:00:00 2001 From: Patrick Niklaus Date: Fri, 28 Oct 2016 14:45:05 -0700 Subject: [PATCH] [skip ci] Fix formating using format.sh --- include/engine/api/json_factory.hpp | 3 +- .../engine/datafacade/shared_datafacade.hpp | 2 +- include/engine/plugins/viaroute.hpp | 3 +- .../routing_algorithms/alternative_path.hpp | 3 +- include/storage/io.hpp | 13 ++++---- include/storage/shared_barriers.hpp | 10 ++---- include/util/graph_loader.hpp | 1 - src/engine/guidance/lane_processing.cpp | 2 +- src/engine/plugins/match.cpp | 3 +- src/engine/plugins/tile.cpp | 32 ++++++++++++------- src/extractor/extraction_containers.cpp | 2 +- src/tools/store.cpp | 12 ++++--- 12 files changed, 45 insertions(+), 41 deletions(-) diff --git a/include/engine/api/json_factory.hpp b/include/engine/api/json_factory.hpp index 17526223a..9be7e3792 100644 --- a/include/engine/api/json_factory.hpp +++ b/include/engine/api/json_factory.hpp @@ -74,8 +74,7 @@ util::json::Object makeGeoJSONGeometry(ForwardIter begin, ForwardIter end) util::json::Object makeStepManeuver(const guidance::StepManeuver &maneuver); -util::json::Object makeRouteStep(guidance::RouteStep step, - util::json::Value geometry); +util::json::Object makeRouteStep(guidance::RouteStep step, util::json::Value geometry); util::json::Object makeRoute(const guidance::Route &route, util::json::Array legs, diff --git a/include/engine/datafacade/shared_datafacade.hpp b/include/engine/datafacade/shared_datafacade.hpp index ee6fdcd52..006daf74e 100644 --- a/include/engine/datafacade/shared_datafacade.hpp +++ b/include/engine/datafacade/shared_datafacade.hpp @@ -17,8 +17,8 @@ #include "util/guidance/turn_lanes.hpp" #include "engine/geospatial_query.hpp" -#include "util/packed_vector.hpp" #include "util/guidance/turn_bearing.hpp" +#include "util/packed_vector.hpp" #include "util/range_table.hpp" #include "util/rectangle.hpp" #include "util/simple_logger.hpp" diff --git a/include/engine/plugins/viaroute.hpp b/include/engine/plugins/viaroute.hpp index a35199c00..9842d4469 100644 --- a/include/engine/plugins/viaroute.hpp +++ b/include/engine/plugins/viaroute.hpp @@ -31,7 +31,8 @@ class ViaRoutePlugin final : public BasePlugin mutable SearchEngineData heaps; mutable routing_algorithms::ShortestPathRouting shortest_path; mutable routing_algorithms::AlternativeRouting alternative_path; - mutable routing_algorithms::DirectShortestPathRouting direct_shortest_path; + mutable routing_algorithms::DirectShortestPathRouting + direct_shortest_path; const int max_locations_viaroute; public: diff --git a/include/engine/routing_algorithms/alternative_path.hpp b/include/engine/routing_algorithms/alternative_path.hpp index 42bb49421..424cf5cb7 100644 --- a/include/engine/routing_algorithms/alternative_path.hpp +++ b/include/engine/routing_algorithms/alternative_path.hpp @@ -843,8 +843,7 @@ class AlternativeRouting final const NodeID via_path_middle_node_id = current_edge_data.id; const EdgeID second_segment_edge_id = facade.FindEdgeInEitherDirection(via_path_middle_node_id, via_path_edge.second); - const int second_segment_length = - facade.GetEdgeData(second_segment_edge_id).weight; + const int second_segment_length = facade.GetEdgeData(second_segment_edge_id).weight; // attention: !unpacking in reverse! // Check if second segment is the one to go over treshold? if yes add second segment // to stack, else push first segment to stack and add weight of second one. diff --git a/include/storage/io.hpp b/include/storage/io.hpp index f7407eb18..94e233e39 100644 --- a/include/storage/io.hpp +++ b/include/storage/io.hpp @@ -81,10 +81,10 @@ inline HSGRHeader readHSGRHeader(boost::filesystem::ifstream &input_stream) using NodeT = typename util::StaticGraph::NodeArrayEntry; using EdgeT = typename util::StaticGraph::EdgeArrayEntry; inline void readHSGR(boost::filesystem::ifstream &input_stream, - NodeT *node_buffer, - const std::uint64_t number_of_nodes, - EdgeT *edge_buffer, - const std::uint64_t number_of_edges) + NodeT *node_buffer, + const std::uint64_t number_of_nodes, + EdgeT *edge_buffer, + const std::uint64_t number_of_edges) { BOOST_ASSERT(node_buffer); BOOST_ASSERT(edge_buffer); @@ -177,7 +177,6 @@ void readNodes(boost::filesystem::ifstream &nodes_input_stream, } } - // Reads datasource names out of .datasource_names files and metadata such as // the length and offset of each name struct DatasourceNamesData @@ -186,7 +185,8 @@ struct DatasourceNamesData std::vector offsets; std::vector lengths; }; -inline DatasourceNamesData readDatasourceNames(boost::filesystem::ifstream &datasource_names_input_stream) +inline DatasourceNamesData +readDatasourceNames(boost::filesystem::ifstream &datasource_names_input_stream) { DatasourceNamesData datasource_names_data; std::string name; @@ -215,7 +215,6 @@ void readRamIndex(boost::filesystem::ifstream &ram_index_input_stream, ram_index_input_stream.read(reinterpret_cast(rtree_buffer), sizeof(RTreeNodeT) * tree_size); } - } } } diff --git a/include/storage/shared_barriers.hpp b/include/storage/shared_barriers.hpp index 0a72c4774..574bdfaf5 100644 --- a/include/storage/shared_barriers.hpp +++ b/include/storage/shared_barriers.hpp @@ -23,14 +23,8 @@ struct SharedBarriers { boost::interprocess::named_sharable_mutex::remove("current_regions"); } - static void resetRegions1() - { - boost::interprocess::named_sharable_mutex::remove("regions_1"); - } - static void resetRegions2() - { - boost::interprocess::named_sharable_mutex::remove("regions_2"); - } + static void resetRegions1() { boost::interprocess::named_sharable_mutex::remove("regions_1"); } + static void resetRegions2() { boost::interprocess::named_sharable_mutex::remove("regions_2"); } boost::interprocess::named_upgradable_mutex current_regions_mutex; boost::interprocess::named_sharable_mutex regions_1_mutex; diff --git a/include/util/graph_loader.hpp b/include/util/graph_loader.hpp index d06b66937..7e6417823 100644 --- a/include/util/graph_loader.hpp +++ b/include/util/graph_loader.hpp @@ -147,7 +147,6 @@ NodeID loadEdgesFromFile(std::istream &input_stream, return m; } - } } diff --git a/src/engine/guidance/lane_processing.cpp b/src/engine/guidance/lane_processing.cpp index cdf967969..6512b8a9f 100644 --- a/src/engine/guidance/lane_processing.cpp +++ b/src/engine/guidance/lane_processing.cpp @@ -2,9 +2,9 @@ #include "util/group_by.hpp" #include "util/guidance/toolkit.hpp" +#include "extractor/guidance/toolkit.hpp" #include "extractor/guidance/turn_instruction.hpp" #include "engine/guidance/post_processing.hpp" -#include "extractor/guidance/toolkit.hpp" #include #include diff --git a/src/engine/plugins/match.cpp b/src/engine/plugins/match.cpp index 83a50b66f..fd814c616 100644 --- a/src/engine/plugins/match.cpp +++ b/src/engine/plugins/match.cpp @@ -132,7 +132,8 @@ Status MatchPlugin::HandleRequest(const std::shared_ptrGetUncompressedForwardDatasources(edge.packed_geometry_id); + const auto forward_datasource_vector = + facade->GetUncompressedForwardDatasources(edge.packed_geometry_id); const auto reverse_datasource_vector = facade->GetUncompressedReverseDatasources(edge.packed_geometry_id); @@ -614,8 +615,7 @@ Status TilePlugin::HandleRequest(const std::shared_ptrGetCoordinateOfNode(edge.u); const auto b = facade->GetCoordinateOfNode(edge.v); // Calculate the length in meters - const double length = osrm::util::coordinate_calculation::haversineDistance(a, b); + const double length = + osrm::util::coordinate_calculation::haversineDistance(a, b); - const auto forward_weight_vector = facade->GetUncompressedForwardWeights(edge.packed_geometry_id); - const auto reverse_weight_vector = facade->GetUncompressedReverseWeights(edge.packed_geometry_id); - const auto forward_datasource_vector = facade->GetUncompressedForwardDatasources(edge.packed_geometry_id); - const auto reverse_datasource_vector = facade->GetUncompressedReverseDatasources(edge.packed_geometry_id); + const auto forward_weight_vector = + facade->GetUncompressedForwardWeights(edge.packed_geometry_id); + const auto reverse_weight_vector = + facade->GetUncompressedReverseWeights(edge.packed_geometry_id); + const auto forward_datasource_vector = + facade->GetUncompressedForwardDatasources(edge.packed_geometry_id); + const auto reverse_datasource_vector = + facade->GetUncompressedReverseDatasources(edge.packed_geometry_id); const auto forward_weight = forward_weight_vector[edge.fwd_segment_position]; - const auto reverse_weight = reverse_weight_vector[reverse_weight_vector.size() - edge.fwd_segment_position - 1]; - const auto forward_datasource = forward_datasource_vector[edge.fwd_segment_position]; - const auto reverse_datasource = reverse_datasource_vector[reverse_datasource_vector.size() - edge.fwd_segment_position - 1]; + const auto reverse_weight = + reverse_weight_vector[reverse_weight_vector.size() - + edge.fwd_segment_position - 1]; + const auto forward_datasource = + forward_datasource_vector[edge.fwd_segment_position]; + const auto reverse_datasource = + reverse_datasource_vector[reverse_datasource_vector.size() - + edge.fwd_segment_position - 1]; use_line_value(reverse_weight); use_line_value(forward_weight); diff --git a/src/extractor/extraction_containers.cpp b/src/extractor/extraction_containers.cpp index 891ea66d9..9a40367f2 100644 --- a/src/extractor/extraction_containers.cpp +++ b/src/extractor/extraction_containers.cpp @@ -98,7 +98,7 @@ struct CmpEdgeByInternalSourceTargetAndName value_type max_value() { return value_type::max_internal_value(); } value_type min_value() { return value_type::min_internal_value(); } - std::mutex& mutex; + std::mutex &mutex; const oe::ExtractionContainers::STXXLNameCharData &name_data; const oe::ExtractionContainers::STXXLNameOffsets &name_offsets; }; diff --git a/src/tools/store.cpp b/src/tools/store.cpp index 2e8278ad5..03e1df4ad 100644 --- a/src/tools/store.cpp +++ b/src/tools/store.cpp @@ -22,9 +22,10 @@ bool generateDataStoreOptions(const int argc, // declare a group of options that will be allowed both on command line // as well as in a config file boost::program_options::options_description config_options("Configuration"); - config_options.add_options()("max-wait", - boost::program_options::value(&max_wait)->default_value(-1), - "Maximum number of seconds to wait on requests that use the old dataset."); + config_options.add_options()( + "max-wait", + boost::program_options::value(&max_wait)->default_value(-1), + "Maximum number of seconds to wait on requests that use the old dataset."); // hidden options, will be allowed on command line but will not be shown to the user boost::program_options::options_description hidden_options("Hidden options"); @@ -110,11 +111,12 @@ int main(const int argc, const char *argv[]) try const constexpr unsigned MAX_RETRIES = 3; unsigned retry_counter = 0; storage::Storage::ReturnCode code = storage::Storage::ReturnCode::Retry; - while(code == storage::Storage::ReturnCode::Retry && retry_counter < MAX_RETRIES) + while (code == storage::Storage::ReturnCode::Retry && retry_counter < MAX_RETRIES) { if (retry_counter > 0) { - util::SimpleLogger().Write(logWARNING) << "Try number " << (retry_counter+1) << " to load the dataset."; + util::SimpleLogger().Write(logWARNING) << "Try number " << (retry_counter + 1) + << " to load the dataset."; } code = storage.Run(max_wait); retry_counter++;