Upgrade formatting to clang-format 10 (#5895)

* Update formatting tools to clang-format-10

* Reformat using clang-format-10.0.09
This commit is contained in:
Daniel Patterson
2020-11-26 07:21:39 -08:00
committed by GitHub
parent a3f1c2afb0
commit 50d9632ed7
373 changed files with 1198 additions and 1163 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ struct interger_alias
struct double_alias
{
};
}
} // namespace tag
int main(int, char **)
{
+2 -1
View File
@@ -18,7 +18,8 @@
#include <cstdlib>
int main(int argc, const char *argv[]) try
int main(int argc, const char *argv[])
try
{
if (argc < 2)
{
+2 -2
View File
@@ -74,8 +74,8 @@ void benchmark(BenchStaticRTree &rtree, unsigned num_queries)
return rtree.Nearest(q, 10);
});
}
}
}
} // namespace benchmarks
} // namespace osrm
int main(int argc, char **argv)
{
+3 -3
View File
@@ -45,7 +45,7 @@ void relaxNode(ContractorHeap &heap,
}
}
}
}
} // namespace
void search(ContractorHeap &heap,
const ContractorGraph &graph,
@@ -83,5 +83,5 @@ void search(ContractorHeap &heap,
relaxNode(heap, graph, node, node_weight, forbidden_node);
}
}
}
}
} // namespace contractor
} // namespace osrm
+1 -1
View File
@@ -560,7 +560,7 @@ bool IsNodeIndependent(const util::XORFastHash<> &hash,
}
return true;
}
}
} // namespace
std::vector<bool> contractGraph(ContractorGraph &graph,
std::vector<bool> node_is_uncontracted_,
+2 -2
View File
@@ -118,7 +118,7 @@ std::vector<CellMetric> customizeFilteredMetrics(const partitioner::MultiLevelEd
return metrics;
}
}
} // namespace
int Customizer::Run(const CustomizationConfig &config)
{
@@ -191,5 +191,5 @@ int Customizer::Run(const CustomizationConfig &config)
return 0;
}
} // namespace customizer$
} // namespace customizer
} // namespace osrm
+2 -2
View File
@@ -119,5 +119,5 @@ std::vector<util::Coordinate> douglasPeucker(std::vector<util::Coordinate>::cons
return simplified_geometry;
}
} // ns engine
} // ns osrm
} // namespace engine
} // namespace osrm
+2 -2
View File
@@ -27,5 +27,5 @@ bool EngineConfig::IsValid() const
storage_config.IsValid()) &&
limits_valid;
}
}
}
} // namespace engine
} // namespace osrm
+1 -1
View File
@@ -39,7 +39,7 @@ unsigned calculateOverviewZoomLevel(const std::vector<LegGeometry> &leg_geometri
return util::viewport::getFittedZoom(south_west, north_east);
}
}
} // namespace
std::vector<util::Coordinate> assembleOverview(const std::vector<LegGeometry> &leg_geometries,
const bool use_simplification)
+4 -4
View File
@@ -48,7 +48,7 @@ std::pair<short, short> getArriveBearings(const LegGeometry &leg_geometry,
return std::make_pair<short, short>(
std::round(util::coordinate_calculation::bearing(pre_turn_coordinate, turn_coordinate)), 0);
}
} // ns detail
} // ns engine
} // ns guidance
} // ns detail
} // namespace detail
} // namespace guidance
} // namespace engine
} // namespace osrm
@@ -181,9 +181,10 @@ bool isUTurn(const RouteStepIterator step_prior_to_intersection,
const auto only_allowed_turn = (numberOfAllowedTurns(*step_leaving_intersection) == 1) &&
noIntermediaryIntersections(*step_entering_intersection);
return collapsable || isLinkRoad(*step_prior_to_intersection,
*step_entering_intersection,
*step_leaving_intersection) ||
return collapsable ||
isLinkRoad(*step_prior_to_intersection,
*step_entering_intersection,
*step_leaving_intersection) ||
only_allowed_turn;
}
+3 -2
View File
@@ -706,8 +706,9 @@ void applyOverrides(const datafacade::BaseDataFacade &facade,
<< " direction was "
<< osrm::guidance::instructionModifierToString(
step_to_update->maneuver.instruction.direction_modifier)
<< " now " << osrm::guidance::instructionModifierToString(
maneuver_relation.direction)
<< " now "
<< osrm::guidance::instructionModifierToString(
maneuver_relation.direction)
<< std::endl;
step_to_update->maneuver.instruction.direction_modifier =
maneuver_relation.direction;
+22 -21
View File
@@ -38,29 +38,30 @@ std::vector<RouteStep> suppressShortNameSegments(std::vector<RouteStep> steps)
// suppresses name segments that announce already known names or announce a name that will be
// only available for a very short time
const auto reduce_verbosity_if_possible = [suppress, can_be_extended_to](
RouteStepIterator &current_turn_itr, RouteStepIterator &previous_turn_itr) {
if (haveSameName(*previous_turn_itr, *current_turn_itr))
suppress(*previous_turn_itr, *current_turn_itr);
else
{
// remember the location of the name change so we can advance the previous turn
const auto location_of_name_change = current_turn_itr;
auto distance = current_turn_itr->distance;
// sum up all distances that can be relevant to the name change
while (can_be_extended_to(*(current_turn_itr + 1)) &&
distance < NAME_SEGMENT_CUTOFF_LENGTH)
{
++current_turn_itr;
distance += current_turn_itr->distance;
}
if (distance < NAME_SEGMENT_CUTOFF_LENGTH)
const auto reduce_verbosity_if_possible =
[suppress, can_be_extended_to](RouteStepIterator &current_turn_itr,
RouteStepIterator &previous_turn_itr) {
if (haveSameName(*previous_turn_itr, *current_turn_itr))
suppress(*previous_turn_itr, *current_turn_itr);
else
previous_turn_itr = location_of_name_change;
}
};
{
// remember the location of the name change so we can advance the previous turn
const auto location_of_name_change = current_turn_itr;
auto distance = current_turn_itr->distance;
// sum up all distances that can be relevant to the name change
while (can_be_extended_to(*(current_turn_itr + 1)) &&
distance < NAME_SEGMENT_CUTOFF_LENGTH)
{
++current_turn_itr;
distance += current_turn_itr->distance;
}
if (distance < NAME_SEGMENT_CUTOFF_LENGTH)
suppress(*previous_turn_itr, *current_turn_itr);
else
previous_turn_itr = location_of_name_change;
}
};
BOOST_ASSERT(!hasTurnType(steps.back()) && hasWaypointType(steps.back()));
for (auto previous_turn_itr = steps.begin(), current_turn_itr = std::next(previous_turn_itr);
+2 -2
View File
@@ -57,5 +57,5 @@ bool operator==(const Hint &lhs, const Hint &rhs)
std::ostream &operator<<(std::ostream &out, const Hint &hint) { return out << hint.ToBase64(); }
} // ns engine
} // ns osrm
} // namespace engine
} // namespace osrm
+3 -4
View File
@@ -207,7 +207,6 @@ Status MatchPlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
{
return routing_algorithms::DEFAULT_GPS_PRECISION * RADIUS_MULTIPLIER;
}
});
}
@@ -314,6 +313,6 @@ Status MatchPlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
return Status::Ok;
}
}
}
}
} // namespace plugins
} // namespace engine
} // namespace osrm
+3 -3
View File
@@ -60,6 +60,6 @@ Status NearestPlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms
return Status::Ok;
}
}
}
}
} // namespace plugins
} // namespace engine
} // namespace osrm
+3 -3
View File
@@ -156,6 +156,6 @@ Status TablePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
return Status::Ok;
}
}
}
}
} // namespace plugins
} // namespace engine
} // namespace osrm
+4 -5
View File
@@ -1,6 +1,5 @@
#include "guidance/turn_instruction.hpp"
#include "engine/plugins/plugin_base.hpp"
#include "engine/plugins/plugin_base.hpp"
#include "engine/plugins/tile.hpp"
@@ -661,7 +660,7 @@ void encodeVectorTile(const DataFacadeBase &facade,
tile.serialize(pbf_buffer);
}
}
} // namespace
Status TilePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
const api::TileParameters &parameters,
@@ -697,6 +696,6 @@ Status TilePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
return Status::Ok;
}
}
}
}
} // namespace plugins
} // namespace engine
} // namespace osrm
+6 -5
View File
@@ -204,8 +204,9 @@ Status TripPlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
}
BOOST_ASSERT(phantom_node_pairs.size() == number_of_locations);
if (fixed_start && fixed_end && (source_id >= parameters.coordinates.size() ||
destination_id >= parameters.coordinates.size()))
if (fixed_start && fixed_end &&
(source_id >= parameters.coordinates.size() ||
destination_id >= parameters.coordinates.size()))
{
return Error("InvalidValue", "Invalid source or destination value.", result);
}
@@ -278,6 +279,6 @@ Status TripPlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
return Status::Ok;
}
}
}
}
} // namespace plugins
} // namespace engine
} // namespace osrm
+3 -3
View File
@@ -183,6 +183,6 @@ Status ViaRoutePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithm
return Status::Ok;
}
}
}
}
} // namespace plugins
} // namespace engine
} // namespace osrm
+3 -3
View File
@@ -75,6 +75,6 @@ std::int32_t decode_polyline_integer(std::string::const_iterator &first,
result = ((result & 1) == 1) ? ~(result >> 1) : (result >> 1);
return static_cast<std::int32_t>(result);
}
}
}
}
} // namespace detail
} // namespace engine
} // namespace osrm
@@ -558,7 +558,7 @@ bool viaNodeCandidatePassesTTest(SearchEngineData<Algorithm> &engine_working_dat
}
return (upper_bound <= t_test_path_weight);
}
} // anon. namespace
} // namespace
InternalManyRoutesResult alternativePathSearch(SearchEngineData<Algorithm> &engine_working_data,
const DataFacade<Algorithm> &facade,
@@ -853,4 +853,4 @@ InternalManyRoutesResult alternativePathSearch(SearchEngineData<Algorithm> &engi
} // namespace routing_algorithms
} // namespace engine
} // namespace osrm}
} // namespace osrm
@@ -443,9 +443,8 @@ void forwardRoutingStep(const DataFacade<Algorithm> &facade,
auto new_duration = source_duration + target_duration;
auto new_distance = source_distance + target_distance;
if (new_weight >= 0 &&
std::tie(new_weight, new_duration, new_distance) <
std::tie(current_weight, current_duration, current_distance))
if (new_weight >= 0 && std::tie(new_weight, new_duration, new_distance) <
std::tie(current_weight, current_duration, current_distance))
{
current_weight = new_weight;
current_duration = new_duration;
@@ -65,7 +65,7 @@ inline void initializeHeap<mld::Algorithm>(SearchEngineData<mld::Algorithm> &eng
const auto border_nodes_number = facade.GetMaxBorderNodeID() + 1;
engine_working_data.InitializeOrClearFirstThreadLocalStorage(nodes_number, border_nodes_number);
}
}
} // namespace
template <typename Algorithm>
SubMatchingList mapMatching(SearchEngineData<Algorithm> &engine_working_data,
+2 -2
View File
@@ -130,5 +130,5 @@ void SearchEngineData<MLD>::InitializeOrClearManyToManyThreadLocalStorage(
many_to_many_heap.reset(new ManyToManyQueryHeap(number_of_nodes, number_of_boundary_nodes));
}
}
}
}
} // namespace engine
} // namespace osrm
+2 -2
View File
@@ -396,5 +396,5 @@ std::unique_ptr<SegmentDataContainer> CompressedEdgeContainer::ToSegmentData()
return std::move(segment_data);
}
}
}
} // namespace extractor
} // namespace osrm
+17 -20
View File
@@ -51,7 +51,7 @@ template <> struct hash<std::pair<NodeID, NodeID>>
return seed;
}
};
}
} // namespace std
namespace osrm
{
@@ -548,22 +548,21 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges(
&scripting_environment,
weight_multiplier,
&conditional_restriction_map](
// what nodes will be used? In most cases this will be the id
// stored in the edge_data. In case of duplicated nodes (e.g.
// due to via-way restrictions), one/both of these might
// refer to a newly added edge based node
const auto edge_based_node_from,
const auto edge_based_node_to,
// the situation of the turn
const auto node_along_road_entering,
const auto node_based_edge_from,
const auto intersection_node,
const auto node_based_edge_to,
const auto &turn_angle,
const auto &road_legs_on_the_right,
const auto &road_legs_on_the_left,
const auto &edge_geometries) {
// what nodes will be used? In most cases this will be the id
// stored in the edge_data. In case of duplicated nodes (e.g.
// due to via-way restrictions), one/both of these might
// refer to a newly added edge based node
const auto edge_based_node_from,
const auto edge_based_node_to,
// the situation of the turn
const auto node_along_road_entering,
const auto node_based_edge_from,
const auto intersection_node,
const auto node_based_edge_to,
const auto &turn_angle,
const auto &road_legs_on_the_right,
const auto &road_legs_on_the_left,
const auto &edge_geometries) {
const auto node_restricted =
isRestricted(node_along_road_entering,
intersection_node,
@@ -687,7 +686,6 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges(
//
tbb::filter_t<tbb::blocked_range<NodeID>, EdgesPipelineBufferPtr> processor_stage(
tbb::filter::parallel, [&](const tbb::blocked_range<NodeID> &intersection_node_range) {
auto buffer = std::make_shared<EdgesPipelineBuffer>();
buffer->nodes_processed = intersection_node_range.size();
@@ -885,7 +883,7 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges(
// TODO: this loop is not optimized - once we have a few
// overrides available, we should index this for faster
// lookups
for (auto & override : unresolved_maneuver_overrides)
for (auto &override : unresolved_maneuver_overrides)
{
for (auto &turn : override.turn_sequence)
{
@@ -1026,7 +1024,6 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges(
std::vector<EdgeWithData> delayed_data;
tbb::filter_t<EdgesPipelineBufferPtr, void> output_stage(
tbb::filter::serial_in_order, [&](auto buffer) {
routing_progress.PrintAddition(buffer->nodes_processed);
m_connectivity_checksum = buffer->checksum.update_checksum(m_connectivity_checksum);
+6 -7
View File
@@ -99,7 +99,7 @@ inline NodeID mapExternalToInternalNodeID(Iter first, Iter last, const OSMNodeID
return (it == last || value < *it) ? SPECIAL_NODEID
: static_cast<NodeID>(std::distance(first, it));
}
}
} // namespace
namespace osrm
{
@@ -277,8 +277,8 @@ void ExtractionContainers::PrepareEdges(ScriptingEnvironment &scripting_environm
{
if (edge_iterator->result.osm_source_id < node_iterator->node_id)
{
util::Log(logDEBUG) << "Found invalid node reference "
<< edge_iterator->result.source;
util::Log(logDEBUG)
<< "Found invalid node reference " << edge_iterator->result.source;
edge_iterator->result.source = SPECIAL_NODEID;
++edge_iterator;
continue;
@@ -744,7 +744,6 @@ void ExtractionContainers::PrepareManeuverOverrides()
**/
auto const find_turn_from_way_tofrom_nodes = [&](auto const &from_segment,
auto const &to_segment) {
if (from_segment.first_segment_source_id == to_segment.first_segment_source_id)
{
return NodeBasedTurn{osm_node_to_internal_nbn(from_segment.first_segment_target_id),
@@ -861,7 +860,6 @@ void ExtractionContainers::PrepareManeuverOverrides()
// Later, the UnresolvedManeuverOverride will be converted into a final ManeuverOverride
// once the edge-based-node IDs are generated by the edge-based-graph-factory
const auto transform = [&](const auto &external, auto &internal) {
// Create a stub override
auto maneuver_override =
UnresolvedManeuverOverride{{},
@@ -1040,8 +1038,9 @@ void ExtractionContainers::PrepareRestrictions()
// translate the turn from one segment onto another into a node restriction (the ways can
// only
// be connected at a single location)
auto const get_node_restriction_from_OSM_ids = [&](
auto const from_id, auto const to_id, const OSMNodeID via_node) {
auto const get_node_restriction_from_OSM_ids = [&](auto const from_id,
auto const to_id,
const OSMNodeID via_node) {
auto const from_segment_itr = referenced_ways.find(from_id);
if (from_segment_itr->second.way_id != from_id)
{
+3 -3
View File
@@ -552,9 +552,9 @@ Extractor::ParseOSMData(ScriptingEnvironment &scripting_environment,
const auto &rel = static_cast<const osmium::Relation &>(*entity);
const char *rel_type = rel.get_value_by_key("type");
if (!rel_type ||
!std::binary_search(
relation_types.begin(), relation_types.end(), std::string(rel_type)))
if (!rel_type || !std::binary_search(relation_types.begin(),
relation_types.end(),
std::string(rel_type)))
continue;
ExtractionRelation extracted_rel({rel.id(), osmium::item_type::relation});
+1 -1
View File
@@ -75,7 +75,7 @@ void ExtractorCallbacks::ProcessRestriction(const InputConditionalTurnRestrictio
// util::Log() << restriction.toString();
}
void ExtractorCallbacks::ProcessManeuverOverride(const InputManeuverOverride & override)
void ExtractorCallbacks::ProcessManeuverOverride(const InputManeuverOverride &override)
{
external_memory.external_maneuver_overrides_list.push_back(override);
}
+14 -13
View File
@@ -185,17 +185,18 @@ void GraphCompressor::Compress(
* just
* like a barrier.
*/
const auto selectAnnotation = [&node_data_container](
const AnnotationID front_annotation, const AnnotationID back_annotation) {
// A lane has tags: u - (front) - v - (back) - w
// During contraction, we keep only one of the tags. Usually the one closer
// to the intersection is preferred. If its empty, however, we keep the
// non-empty one
if (node_data_container[back_annotation].lane_description_id ==
INVALID_LANE_DESCRIPTIONID)
return front_annotation;
return back_annotation;
};
const auto selectAnnotation =
[&node_data_container](const AnnotationID front_annotation,
const AnnotationID back_annotation) {
// A lane has tags: u - (front) - v - (back) - w
// During contraction, we keep only one of the tags. Usually the one closer
// to the intersection is preferred. If its empty, however, we keep the
// non-empty one
if (node_data_container[back_annotation].lane_description_id ==
INVALID_LANE_DESCRIPTIONID)
return front_annotation;
return back_annotation;
};
graph.GetEdgeData(forward_e1).annotation_data = selectAnnotation(
fwd_edge_data1.annotation_data, fwd_edge_data2.annotation_data);
@@ -371,5 +372,5 @@ void GraphCompressor::PrintStatistics(unsigned original_number_of_nodes,
util::Log() << "Node compression ratio: " << new_node_count / (double)original_number_of_nodes;
util::Log() << "Edge compression ratio: " << new_edge_count / (double)original_number_of_edges;
}
}
}
} // namespace extractor
} // namespace osrm
@@ -55,7 +55,7 @@ double GetOffsetCorrectionFactor(const RoadClassification &road_classification)
return 1.0;
};
}
}
} // namespace
CoordinateExtractor::CoordinateExtractor(
const util::NodeBasedDynamicGraph &node_based_graph,
@@ -146,9 +146,8 @@ util::Coordinate CoordinateExtractor::ExtractRepresentativeCoordinate(
// do the best of what we can.
coordinates =
TrimCoordinatesToLength(std::move(coordinates), LOOKAHEAD_DISTANCE_WITHOUT_LANES);
if (coordinates.size() > 2 &&
util::coordinate_calculation::haversineDistance(turn_coordinate, coordinates[1]) <
ASSUMED_LANE_WIDTH)
if (coordinates.size() > 2 && util::coordinate_calculation::haversineDistance(
turn_coordinate, coordinates[1]) < ASSUMED_LANE_WIDTH)
{
const auto initial_distance =
util::coordinate_calculation::haversineDistance(turn_coordinate, coordinates[1]);
@@ -442,7 +441,7 @@ CoordinateExtractor::ExtractCoordinateAtLength(const double distance,
auto length_cache_itr = length_cache.begin() + 1;
// find the end of the segment containing the coordinate which is at least distance away
const auto find_coordinate_at_distance = [distance, &accumulated_distance, &length_cache_itr](
const util::Coordinate /*coordinate*/) mutable {
const util::Coordinate /*coordinate*/) mutable {
const auto result = (accumulated_distance + *length_cache_itr) >= distance;
if (!result)
{
@@ -474,20 +473,19 @@ util::Coordinate CoordinateExtractor::ExtractCoordinateAtLength(
double accumulated_distance = 0.;
// checks (via its state) for an accumulated distance
const auto coordinate_at_distance =
[ distance, &accumulated_distance, last_coordinate = coordinates.front() ](
const util::Coordinate coordinate) mutable
{
const double segment_distance =
util::coordinate_calculation::haversineDistance(last_coordinate, coordinate);
const auto result = (accumulated_distance + segment_distance) >= distance;
if (!result)
{
accumulated_distance += segment_distance;
last_coordinate = coordinate;
}
[distance, &accumulated_distance, last_coordinate = coordinates.front()](
const util::Coordinate coordinate) mutable {
const double segment_distance =
util::coordinate_calculation::haversineDistance(last_coordinate, coordinate);
const auto result = (accumulated_distance + segment_distance) >= distance;
if (!result)
{
accumulated_distance += segment_distance;
last_coordinate = coordinate;
}
return result;
};
return result;
};
// find the begin of the segment containing the coordinate
const auto coordinate_after =
@@ -532,11 +530,12 @@ util::Coordinate CoordinateExtractor::GetCoordinateCloseToTurn(const NodeID from
// OSM data has a tendency to include repeated nodes with identical coordinates. To skip
// over these, we search for the first coordinate along the path that is at least a meter
// away from the first entry
const auto far_enough_away = [start_coordinate, compressedGeometryToCoordinate](
const CompressedEdgeContainer::OnewayCompressedEdge &compressed_edge) {
return util::coordinate_calculation::haversineDistance(
compressedGeometryToCoordinate(compressed_edge), start_coordinate) > 1;
};
const auto far_enough_away =
[start_coordinate, compressedGeometryToCoordinate](
const CompressedEdgeContainer::OnewayCompressedEdge &compressed_edge) {
return util::coordinate_calculation::haversineDistance(
compressedGeometryToCoordinate(compressed_edge), start_coordinate) > 1;
};
// find the first coordinate, that is at least unequal to the begin of the edge
if (traversed_in_reverse)
@@ -893,19 +892,19 @@ CoordinateExtractor::PrepareLengthCache(const std::vector<util::Coordinate> &coo
segment_distances.reserve(coordinates.size());
segment_distances.push_back(0);
// sentinel
std::find_if(std::next(std::begin(coordinates)), std::end(coordinates), [
last_coordinate = coordinates.front(),
limit,
&segment_distances,
accumulated_distance = 0.
](const util::Coordinate current_coordinate) mutable {
const auto distance =
util::coordinate_calculation::haversineDistance(last_coordinate, current_coordinate);
accumulated_distance += distance;
last_coordinate = current_coordinate;
segment_distances.push_back(distance);
return accumulated_distance >= limit;
});
std::find_if(std::next(std::begin(coordinates)),
std::end(coordinates),
[last_coordinate = coordinates.front(),
limit,
&segment_distances,
accumulated_distance = 0.](const util::Coordinate current_coordinate) mutable {
const auto distance = util::coordinate_calculation::haversineDistance(
last_coordinate, current_coordinate);
accumulated_distance += distance;
last_coordinate = current_coordinate;
segment_distances.push_back(distance);
return accumulated_distance >= limit;
});
return segment_distances;
}
@@ -25,6 +25,6 @@ bool HaveIdenticalNames(const NameID lhs,
!util::guidance::requiresNameAnnounced(rhs, lhs, name_table, street_name_suffix_table);
}
} // namespace guidance
} // namespace intersection
} // namespace extractor
} // namespace osrm
+2 -2
View File
@@ -21,8 +21,8 @@ bool IntersectionViewData::CompareByAngle(const IntersectionViewData &other) con
std::string toString(const IntersectionEdgeGeometry &shape)
{
std::string result = "[shape] " + std::to_string(shape.eid) + " bearing: " +
std::to_string(shape.perceived_bearing);
std::string result = "[shape] " + std::to_string(shape.eid) +
" bearing: " + std::to_string(shape.perceived_bearing);
return result;
}
@@ -248,7 +248,7 @@ getIntersectionOutgoingGeometries(const util::NodeBasedDynamicGraph &graph,
});
return edge_geometries;
}
}
} // namespace
std::pair<IntersectionEdgeGeometries, std::unordered_set<EdgeID>>
getIntersectionGeometries(const util::NodeBasedDynamicGraph &graph,
@@ -827,6 +827,6 @@ IntersectionEdge skipDegreeTwoNodes(const util::NodeBasedDynamicGraph &graph, In
return road;
}
}
}
}
} // namespace intersection
} // namespace extractor
} // namespace osrm
@@ -31,7 +31,7 @@ inline auto makeCheckRoadForName(const NameID name_id,
const SuffixTable &suffix_table)
{
return [name_id, &node_based_graph, &node_data_container, &name_table, &suffix_table](
const MergableRoadDetector::MergableRoadData &road) {
const MergableRoadDetector::MergableRoadData &road) {
// since we filter here, we don't want any other name than the one we are looking for
const auto road_name_id =
node_data_container
@@ -49,7 +49,7 @@ inline auto makeCheckRoadForName(const NameID name_id,
return requires_announcement;
};
}
}
} // namespace
MergableRoadDetector::MergableRoadDetector(
const util::NodeBasedDynamicGraph &node_based_graph,
@@ -70,12 +70,12 @@ SelectRoadByNameOnlyChoiceAndStraightness::SelectRoadByNameOnlyChoiceAndStraight
{
}
boost::optional<EdgeID> SelectRoadByNameOnlyChoiceAndStraightness::
operator()(const NodeID /*nid*/,
const EdgeID /*via_edge_id*/,
const IntersectionView &intersection,
const util::NodeBasedDynamicGraph &node_based_graph,
const EdgeBasedNodeDataContainer &node_data_container) const
boost::optional<EdgeID> SelectRoadByNameOnlyChoiceAndStraightness::operator()(
const NodeID /*nid*/,
const EdgeID /*via_edge_id*/,
const IntersectionView &intersection,
const util::NodeBasedDynamicGraph &node_based_graph,
const EdgeBasedNodeDataContainer &node_data_container) const
{
BOOST_ASSERT(!intersection.empty());
const auto comparator = [&](const IntersectionViewData &lhs, const IntersectionViewData &rhs) {
@@ -120,12 +120,12 @@ SelectStraightmostRoadByNameAndOnlyChoice::SelectStraightmostRoadByNameAndOnlyCh
{
}
boost::optional<EdgeID> SelectStraightmostRoadByNameAndOnlyChoice::
operator()(const NodeID /*nid*/,
const EdgeID /*via_edge_id*/,
const IntersectionView &intersection,
const util::NodeBasedDynamicGraph &node_based_graph,
const EdgeBasedNodeDataContainer &node_data_container) const
boost::optional<EdgeID> SelectStraightmostRoadByNameAndOnlyChoice::operator()(
const NodeID /*nid*/,
const EdgeID /*via_edge_id*/,
const IntersectionView &intersection,
const util::NodeBasedDynamicGraph &node_based_graph,
const EdgeBasedNodeDataContainer &node_data_container) const
{
BOOST_ASSERT(!intersection.empty());
if (intersection.size() == 1)
+2 -3
View File
@@ -218,7 +218,6 @@ std::vector<std::size_t> LocationDependentData::GetPropertyIndexes(const point_t
// Search the R-tree and collect a Lua table of tags that correspond to the location
rtree.query(boost::geometry::index::intersects(point) &&
boost::geometry::index::satisfies([this, &point](const rtree_t::value_type &v) {
// Simple point-in-polygon algorithm adapted from
// https://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
@@ -276,5 +275,5 @@ std::vector<std::size_t> LocationDependentData::GetPropertyIndexes(const point_t
return result;
}
}
}
} // namespace extractor
} // namespace osrm
@@ -136,5 +136,5 @@ ManeuverOverrideRelationParser::TryParse(const osmium::Relation &relation) const
}
return maneuver_override;
}
}
}
} // namespace extractor
} // namespace osrm
+2 -2
View File
@@ -169,5 +169,5 @@ RasterContainer::GetRasterInterpolateFromSource(unsigned int source_id, double l
}
RasterCache *RasterCache::g_instance = NULL;
}
}
} // namespace extractor
} // namespace osrm
+2 -2
View File
@@ -255,5 +255,5 @@ bool RestrictionParser::ShouldIgnoreRestriction(const std::string &except_tag_st
std::find(std::begin(restrictions), std::end(restrictions), current_string);
});
}
}
}
} // namespace extractor
} // namespace osrm
+4 -5
View File
@@ -37,7 +37,7 @@ template <> struct is_container<osmium::Way> : std::false_type
template <> struct is_container<osmium::Relation> : std::false_type
{
};
}
} // namespace sol
namespace osrm
{
@@ -91,7 +91,7 @@ struct to_lua_object : public boost::static_visitor<sol::object>
auto operator()(boost::blank &) const { return sol::nil; }
sol::state &state;
};
}
} // namespace
Sol2ScriptingEnvironment::Sol2ScriptingEnvironment(
const std::string &file_name,
@@ -424,8 +424,8 @@ void Sol2ScriptingEnvironment::InitContext(LuaScriptingContext &context)
"get_relations",
[&getTypedRefBySol](ExtractionRelationContainer &cont, const sol::object &obj)
-> const ExtractionRelationContainer::RelationIDList & {
return cont.GetRelations(getTypedRefBySol(obj));
},
return cont.GetRelations(getTypedRefBySol(obj));
},
"relation",
[](ExtractionRelationContainer &cont, const ExtractionRelation::OsmIDTyped &rel_id)
-> const ExtractionRelation & { return cont.GetRelationData(rel_id); });
@@ -589,7 +589,6 @@ void Sol2ScriptingEnvironment::InitContext(LuaScriptingContext &context)
};
auto initialize_V3_extraction_turn = [&]() {
context.state.new_usertype<ExtractionTurn>(
"ExtractionTurn",
"angle",
+3 -2
View File
@@ -58,8 +58,9 @@ bool DrivewayHandler::canProcess(const NodeID /*nid*/,
return static_cast<std::size_t>(low_priority_count) + 2 == intersection.size();
}
Intersection DrivewayHandler::
operator()(const NodeID nid, const EdgeID source_edge_id, Intersection intersection) const
Intersection DrivewayHandler::operator()(const NodeID nid,
const EdgeID source_edge_id,
Intersection intersection) const
{
auto road =
std::find_if(intersection.begin() + 1, intersection.end(), [this](const auto &road) {
-2
View File
@@ -118,7 +118,6 @@ void annotateTurns(const util::NodeBasedDynamicGraph &node_based_graph,
//
tbb::filter_t<tbb::blocked_range<NodeID>, TurnsPipelineBufferPtr> guidance_stage(
tbb::filter::parallel, [&](const tbb::blocked_range<NodeID> &intersection_node_range) {
auto buffer = std::make_shared<TurnsPipelineBuffer>();
buffer->nodes_processed = intersection_node_range.size();
@@ -302,7 +301,6 @@ void annotateTurns(const util::NodeBasedDynamicGraph &node_based_graph,
tbb::filter_t<TurnsPipelineBufferPtr, void> guidance_output_stage(
tbb::filter::serial_in_order, [&](auto buffer) {
guidance_progress.PrintAddition(buffer->nodes_processed);
connectivity_checksum = buffer->checksum.update_checksum(connectivity_checksum);
+2 -2
View File
@@ -92,8 +92,8 @@ bool MotorwayHandler::canProcess(const NodeID,
return has_motorway || from_motorway;
}
Intersection MotorwayHandler::
operator()(const NodeID, const EdgeID via_eid, Intersection intersection) const
Intersection
MotorwayHandler::operator()(const NodeID, const EdgeID via_eid, Intersection intersection) const
{
// coming from motorway
if (isMotorwayClass(via_eid, node_based_graph))
+6 -3
View File
@@ -57,8 +57,9 @@ bool RoundaboutHandler::canProcess(const NodeID from_nid,
return roundabout_type != RoundaboutType::None;
}
Intersection RoundaboutHandler::
operator()(const NodeID from_nid, const EdgeID via_eid, Intersection intersection) const
Intersection RoundaboutHandler::operator()(const NodeID from_nid,
const EdgeID via_eid,
Intersection intersection) const
{
const auto flags = getRoundaboutFlags(from_nid, via_eid, intersection);
const auto roundabout_type = getRoundaboutType(node_based_graph.GetTarget(via_eid));
@@ -211,7 +212,9 @@ RoundaboutType RoundaboutHandler::getRoundaboutType(const NodeID nid) const
std::unordered_set<unsigned> connected_names;
const auto getNextOnRoundabout = [this, &roundabout_name_ids, &connected_names](
const NodeID node, const bool roundabout, const bool circular) {
const NodeID node,
const bool roundabout,
const bool circular) {
BOOST_ASSERT(roundabout != circular);
EdgeID continue_edge = SPECIAL_EDGEID;
for (const auto edge_id : node_based_graph.GetAdjacentEdgeRange(node))
+3 -3
View File
@@ -67,8 +67,9 @@ bool SliproadHandler::canProcess(const NodeID /*nid*/,
// ^ a nid
// ^ ab source_edge_id
// ^ b intersection
Intersection SliproadHandler::
operator()(const NodeID /*nid*/, const EdgeID source_edge_id, Intersection intersection) const
Intersection SliproadHandler::operator()(const NodeID /*nid*/,
const EdgeID source_edge_id,
Intersection intersection) const
{
BOOST_ASSERT(intersection.size() > 2);
@@ -506,7 +507,6 @@ operator()(const NodeID /*nid*/, const EdgeID source_edge_id, Intersection inter
candidate_data.name_id, //
name_table, //
street_name_suffix_table); //
};
const auto candidate_road_name_mismatch = std::all_of(begin(target_road_name_ids), //
+4 -4
View File
@@ -61,8 +61,8 @@ bool SuppressModeHandler::canProcess(const NodeID,
return (suppress_in_mode != end(suppressed)) && all_share_mode;
}
Intersection SuppressModeHandler::
operator()(const NodeID, const EdgeID, Intersection intersection) const
Intersection
SuppressModeHandler::operator()(const NodeID, const EdgeID, Intersection intersection) const
{
const auto first = begin(intersection);
const auto last = end(intersection);
@@ -77,5 +77,5 @@ operator()(const NodeID, const EdgeID, Intersection intersection) const
return intersection;
}
}
}
} // namespace guidance
} // namespace osrm
+3 -3
View File
@@ -68,7 +68,7 @@ InputIt findOutermostForkCandidate(const InputIt begin, const InputIt end)
return outermost - 1;
}
}
}
} // namespace
namespace osrm
{
@@ -137,8 +137,8 @@ bool TurnHandler::canProcess(const NodeID, const EdgeID, const Intersection &) c
// Handles and processes possible turns
// Input parameters describe an intersection as described in
// #IntersectionExplanation@intersection_handler.hpp
Intersection TurnHandler::
operator()(const NodeID, const EdgeID via_edge, Intersection intersection) const
Intersection
TurnHandler::operator()(const NodeID, const EdgeID via_edge, Intersection intersection) const
{
if (intersection.size() == 1)
return handleOneWayTurn(std::move(intersection));
+2 -3
View File
@@ -227,9 +227,8 @@ LaneDataVector handleRenamingSituations(const std::size_t none_index,
lane_data[none_index].to = lane_data[none_index].from;
}
}
else if (has_through &&
(lane_data.size() == 1 ||
lane_data[none_index + 1].tag != extractor::TurnLaneType::straight))
else if (has_through && (lane_data.size() == 1 || lane_data[none_index + 1].tag !=
extractor::TurnLaneType::straight))
{
lane_data[none_index].tag = extractor::TurnLaneType::straight;
}
-1
View File
@@ -655,7 +655,6 @@ std::pair<LaneDataVector, LaneDataVector> TurnLaneHandler::partitionLaneData(
data.from = std::min(turn_lane_data[lane].from, data.from);
data.to = std::max(turn_lane_data[lane].to, data.to);
}
};
LaneDataVector first, second;
+1 -1
View File
@@ -272,6 +272,6 @@ Intersection triviallyMatchLanesToTurns(Intersection intersection,
return intersection;
}
} // namespace lane_matching
} // namespace lanes
} // namespace guidance
} // namespace osrm
+4 -2
View File
@@ -149,7 +149,8 @@ inline void async(const Nan::FunctionCallbackInfo<v8::Value> &info,
{
}
void Execute() override try
void Execute() override
try
{
osrm::engine::api::ResultT r;
r = osrm::util::json::Object();
@@ -230,7 +231,8 @@ inline void asyncForTiles(const Nan::FunctionCallbackInfo<v8::Value> &info,
{
}
void Execute() override try
void Execute() override
try
{
result = std::string();
const auto status = ((*osrm).*(service))(*params, result);
+1 -1
View File
@@ -9,4 +9,4 @@ namespace osrm
void contract(const contractor::ContractorConfig &config) { contractor::Contractor(config).Run(); }
} // ns osrm
} // namespace osrm
+1 -1
View File
@@ -9,4 +9,4 @@ namespace osrm
void customize(const CustomizationConfig &config) { customizer::Customizer().Run(config); }
} // ns osrm
} // namespace osrm
+1 -1
View File
@@ -15,4 +15,4 @@ void extract(const extractor::ExtractorConfig &config)
extractor::Extractor(config).run(scripting_environment);
}
} // ns osrm
} // namespace osrm
+1 -1
View File
@@ -92,4 +92,4 @@ engine::Status OSRM::Tile(const engine::api::TileParameters &params,
return engine_->Tile(params, result);
}
} // ns osrm
} // namespace osrm
+1 -1
View File
@@ -9,4 +9,4 @@ namespace osrm
void partition(const PartitionerConfig &config) { partitioner::Partitioner().Run(config); }
} // ns osrm
} // namespace osrm
+3 -3
View File
@@ -109,7 +109,7 @@ void partitionLevel(const std::vector<BisectionID> &node_to_bisection_id,
}
}
}
}
} // namespace
// Implements a greedy algorithm that split cells using the bisection until a target cell size is
// reached
@@ -140,5 +140,5 @@ bisectionToPartition(const std::vector<BisectionID> &node_to_bisection_id,
return std::make_tuple(std::move(partitions), std::move(num_cells));
}
}
}
} // namespace partitioner
} // namespace osrm
-1
View File
@@ -183,7 +183,6 @@ std::size_t DinicMaxFlow::BlockingFlow(FlowEdges &flow,
// augment the flow along a path in the level graph
const auto augment_flow = [&flow](const std::vector<NodeID> &path) {
// add/remove flow edges from the current residual graph
const auto augment_one = [&flow](const NodeID from, const NodeID to) {
// check if there is flow in the opposite direction
+1 -1
View File
@@ -149,7 +149,7 @@ DinicMaxFlow::MinCut bestMinCut(const BisectionGraphView &view,
return best;
}
}
} // namespace
DinicMaxFlow::MinCut computeInertialFlowCut(const BisectionGraphView &view,
const std::size_t num_slopes,
+3 -3
View File
@@ -36,7 +36,7 @@ std::vector<LevelID> getHighestBorderLevel(const DynamicEdgeBasedGraph &graph,
return border_level;
}
}
} // namespace
std::vector<std::uint32_t> makePermutation(const DynamicEdgeBasedGraph &graph,
const std::vector<Partition> &partitions)
@@ -66,5 +66,5 @@ std::vector<std::uint32_t> makePermutation(const DynamicEdgeBasedGraph &graph,
return util::orderingToPermutation(ordering);
}
}
}
} // namespace partitioner
} // namespace osrm
+4 -4
View File
@@ -62,7 +62,7 @@ boost::optional<ParameterT> parseParameters(std::string::iterator &iter,
return boost::none;
}
} // ns detail
} // namespace detail
template <>
boost::optional<engine::api::RouteParameters> parseParameters(std::string::iterator &iter,
@@ -110,6 +110,6 @@ boost::optional<engine::api::TileParameters> parseParameters(std::string::iterat
return detail::parseParameters<engine::api::TileParameters, TileParametersGrammar<>>(iter, end);
}
} // ns api
} // ns server
} // ns osrm
} // namespace api
} // namespace server
} // namespace osrm
+4 -4
View File
@@ -60,7 +60,7 @@ struct URLParser final : qi::grammar<Iterator, Into>
qi::rule<Iterator, char()> percent_encoding;
};
} // anon.
} // namespace
namespace osrm
{
@@ -93,6 +93,6 @@ boost::optional<ParsedURL> parseURL(std::string::iterator &iter, const std::stri
return boost::none;
}
} // api
} // server
} // osrm
} // namespace api
} // namespace server
} // namespace osrm
+2 -2
View File
@@ -211,5 +211,5 @@ std::vector<char> Connection::compress_buffers(const std::vector<char> &uncompre
return compressed_data;
}
}
}
} // namespace server
} // namespace osrm
+3 -3
View File
@@ -104,6 +104,6 @@ boost::asio::const_buffer reply::status_to_buffer(const reply::status_type statu
}
reply::reply() : status(ok) {}
}
}
}
} // namespace http
} // namespace server
} // namespace osrm
+2 -2
View File
@@ -177,5 +177,5 @@ void RequestHandler::HandleRequest(const http::request &current_request, http::r
<< ", uri: " << current_request.uri;
}
}
}
}
} // namespace server
} // namespace osrm
+2 -2
View File
@@ -298,5 +298,5 @@ bool RequestParser::is_digit(const int character) const
{
return character >= '0' && character <= '9';
}
}
}
} // namespace server
} // namespace osrm
+4 -4
View File
@@ -39,7 +39,7 @@ std::string getWrongOptionHelp(const engine::api::MatchParameters &parameters)
return help;
}
} // anon. ns
} // namespace
engine::Status MatchService::RunQuery(std::size_t prefix_length,
std::string &query,
@@ -78,6 +78,6 @@ engine::Status MatchService::RunQuery(std::size_t prefix_length,
}
return BaseService::routing_machine.Match(*parameters, result);
}
}
}
}
} // namespace service
} // namespace server
} // namespace osrm
+4 -4
View File
@@ -33,7 +33,7 @@ std::string getWrongOptionHelp(const engine::api::NearestParameters &parameters)
return help;
}
} // anon. ns
} // namespace
engine::Status NearestService::RunQuery(std::size_t prefix_length,
std::string &query,
@@ -72,6 +72,6 @@ engine::Status NearestService::RunQuery(std::size_t prefix_length,
}
return BaseService::routing_machine.Nearest(*parameters, result);
}
}
}
}
} // namespace service
} // namespace server
} // namespace osrm
+4 -4
View File
@@ -37,7 +37,7 @@ std::string getWrongOptionHelp(const engine::api::RouteParameters &parameters)
return help;
}
} // anon. ns
} // namespace
engine::Status RouteService::RunQuery(std::size_t prefix_length,
std::string &query,
@@ -76,6 +76,6 @@ engine::Status RouteService::RunQuery(std::size_t prefix_length,
}
return BaseService::routing_machine.Route(*parameters, result);
}
}
}
}
} // namespace service
} // namespace server
} // namespace osrm
+4 -4
View File
@@ -68,7 +68,7 @@ std::string getWrongOptionHelp(const engine::api::TableParameters &parameters)
return help;
}
} // anon. ns
} // namespace
engine::Status TableService::RunQuery(std::size_t prefix_length,
std::string &query,
@@ -107,6 +107,6 @@ engine::Status TableService::RunQuery(std::size_t prefix_length,
}
return BaseService::routing_machine.Table(*parameters, result);
}
}
}
}
} // namespace service
} // namespace server
} // namespace osrm
+3 -3
View File
@@ -47,6 +47,6 @@ engine::Status TileService::RunQuery(std::size_t prefix_length,
result = std::string();
return BaseService::routing_machine.Tile(*parameters, result);
}
}
}
}
} // namespace service
} // namespace server
} // namespace osrm
+4 -4
View File
@@ -39,7 +39,7 @@ std::string getWrongOptionHelp(const engine::api::TripParameters &parameters)
return help;
}
} // anon. ns
} // namespace
engine::Status TripService::RunQuery(std::size_t prefix_length,
std::string &query,
@@ -80,6 +80,6 @@ engine::Status TripService::RunQuery(std::size_t prefix_length,
}
return BaseService::routing_machine.Trip(*parameters, result);
}
}
}
}
} // namespace service
} // namespace server
} // namespace osrm
+2 -2
View File
@@ -51,5 +51,5 @@ engine::Status ServiceHandler::RunQuery(api::ParsedURL parsed_url,
return service->RunQuery(parsed_url.prefix_length, parsed_url.query, result);
}
}
}
} // namespace server
} // namespace osrm
+3 -3
View File
@@ -165,7 +165,7 @@ bool swapData(Monitor &monitor,
return true;
}
}
} // namespace
void populateLayoutFromFile(const boost::filesystem::path &path, storage::BaseDataLayout &layout)
{
@@ -596,5 +596,5 @@ void Storage::PopulateUpdatableData(const SharedDataIndex &index)
}
}
}
}
}
} // namespace storage
} // namespace osrm
+2 -2
View File
@@ -107,8 +107,8 @@ struct FeatureWriter
};
//
}
}
} // namespace tools
} // namespace osrm
int main(int argc, char *argv[])
{
+2 -1
View File
@@ -142,7 +142,8 @@ return_code parseArguments(int argc,
return return_code::ok;
}
int main(int argc, char *argv[]) try
int main(int argc, char *argv[])
try
{
util::LogPolicy::GetInstance().Unmute();
std::string verbosity;
+2 -1
View File
@@ -131,7 +131,8 @@ return_code parseArguments(int argc,
return return_code::ok;
}
int main(int argc, char *argv[]) try
int main(int argc, char *argv[])
try
{
util::LogPolicy::GetInstance().Unmute();
std::string verbosity;
+2 -1
View File
@@ -141,7 +141,8 @@ return_code parseArguments(int argc,
return return_code::ok;
}
int main(int argc, char *argv[]) try
int main(int argc, char *argv[])
try
{
util::LogPolicy::GetInstance().Unmute();
extractor::ExtractorConfig extractor_config;
+2 -2
View File
@@ -45,8 +45,8 @@ void runStatistics(std::vector<double> &timings_vector, Statistics &stats)
timings_vector.begin(), timings_vector.end(), timings_vector.begin(), 0.0);
stats.dev = std::sqrt(primary_sq_sum / timings_vector.size() - (stats.mean * stats.mean));
}
}
}
} // namespace tools
} // namespace osrm
boost::filesystem::path test_path;
+2 -1
View File
@@ -185,7 +185,8 @@ return_code parseArguments(int argc,
return return_code::ok;
}
int main(int argc, char *argv[]) try
int main(int argc, char *argv[])
try
{
util::LogPolicy::GetInstance().Unmute();
std::string verbosity;
+2 -1
View File
@@ -220,7 +220,8 @@ inline unsigned generateServerProgramOptions(const int argc,
return INIT_OK_DO_NOT_START_ENGINE;
}
int main(int argc, const char *argv[]) try
int main(int argc, const char *argv[])
try
{
util::LogPolicy::GetInstance().Unmute();
+2 -1
View File
@@ -221,7 +221,8 @@ bool generateDataStoreOptions(const int argc,
std::_Exit(128 + signum);
}
int main(const int argc, const char *argv[]) try
int main(const int argc, const char *argv[])
try
{
int signals[] = {SIGTERM, SIGSEGV, SIGINT, SIGILL, SIGABRT, SIGFPE};
for (auto sig : signals)
+3 -3
View File
@@ -62,6 +62,6 @@ TurnLookupTable readTurnValues(const std::vector<std::string> &paths)
qi::double_ >> -(',' >> qi::double_));
return parser(paths);
}
}
}
}
} // namespace csv
} // namespace updater
} // namespace osrm
+11 -10
View File
@@ -69,7 +69,7 @@ template <typename T1, typename T2> struct hash<std::tuple<T1, T2>>
return hash_val(std::get<0>(t), std::get<1>(t));
}
};
}
} // namespace std
namespace osrm
{
@@ -162,9 +162,10 @@ updateSegmentData(const UpdaterConfig &config,
// closure to convert SpeedSource value to weight and count fallbacks to durations
std::atomic<std::uint32_t> fallbacks_to_duration{0};
auto convertToWeight = [&profile_properties, &fallbacks_to_duration](
const SegmentWeight &existing_weight, const SpeedSource &value, double distance_in_meters) {
auto convertToWeight = [&profile_properties,
&fallbacks_to_duration](const SegmentWeight &existing_weight,
const SpeedSource &value,
double distance_in_meters) {
double rate = std::numeric_limits<double>::quiet_NaN();
// if value.rate is not set, we fall back to duration
@@ -527,7 +528,7 @@ updateConditionalTurns(std::vector<TurnPenalty> &turn_weight_penalties,
}
return updated_turns;
}
}
} // namespace
EdgeID
Updater::LoadAndUpdateEdgeExpandedGraph(std::vector<extractor::EdgeBasedEdge> &edge_based_edge_list,
@@ -774,9 +775,9 @@ Updater::LoadAndUpdateEdgeExpandedGraph(std::vector<extractor::EdgeBasedEdge> &e
{
if (turn_weight_penalty < 0)
{
util::Log(logWARNING) << "turn penalty " << turn_weight_penalty
<< " is too negative: clamping turn weight to "
<< weight_min_value;
util::Log(logWARNING)
<< "turn penalty " << turn_weight_penalty
<< " is too negative: clamping turn weight to " << weight_min_value;
turn_weight_penalty = weight_min_value - new_weight;
turn_weight_penalties[edge.data.turn_id] = turn_weight_penalty;
}
@@ -830,5 +831,5 @@ Updater::LoadAndUpdateEdgeExpandedGraph(std::vector<extractor::EdgeBasedEdge> &e
util::Log() << "Done reading edges in " << TIMER_MSEC(load_edges) << "ms.";
return number_of_edge_based_nodes;
}
}
}
} // namespace updater
} // namespace osrm
+2 -2
View File
@@ -18,7 +18,7 @@ namespace
std::terminate();
}
}
} // namespace
// Boost.Assert only declares the following two functions and let's us define them here.
namespace boost
@@ -32,4 +32,4 @@ void assertion_failed_msg(
{
::assertion_failed_msg_helper(expr, msg, function, file, line);
}
}
} // namespace boost
+6 -6
View File
@@ -16,8 +16,8 @@ inline std::ostream &operator<<(std::ostream &stream, const ConditionalRestricti
return stream << restriction.value << "=" << restriction.condition;
}
#endif
}
}
} // namespace util
} // namespace osrm
BOOST_FUSION_ADAPT_STRUCT(osrm::util::ConditionalRestriction,
(std::string, value)(std::string, condition))
@@ -33,7 +33,7 @@ namespace
{
namespace ph = boost::phoenix;
namespace qi = boost::spirit::qi;
}
} // namespace
template <typename Iterator, typename Skipper = qi::blank_type>
struct conditional_restrictions_grammar
@@ -76,7 +76,7 @@ struct conditional_restrictions_grammar
qi::rule<Iterator, Skipper, ConditionalRestriction()> restriction;
qi::rule<Iterator, Skipper, std::string()> value, condition;
};
}
} // namespace detail
std::vector<ConditionalRestriction> ParseConditionalRestrictions(const std::string &str)
{
@@ -92,5 +92,5 @@ std::vector<ConditionalRestriction> ParseConditionalRestrictions(const std::stri
return result;
}
} // util
} // osrm
} // namespace util
} // namespace osrm
+2 -2
View File
@@ -42,5 +42,5 @@ bool operator==(const FloatCoordinate lhs, const FloatCoordinate rhs)
bool operator!=(const Coordinate lhs, const Coordinate rhs) { return !(lhs == rhs); }
bool operator!=(const FloatCoordinate lhs, const FloatCoordinate rhs) { return !(lhs == rhs); }
}
}
} // namespace util
} // namespace osrm
+2 -2
View File
@@ -18,5 +18,5 @@ namespace util
void exception::anchor() const {}
void RuntimeError::anchor() const {}
}
}
} // namespace util
} // namespace osrm
+2 -2
View File
@@ -91,5 +91,5 @@ bool FingerPrint::IsDataCompatible(const FingerPrint &other) const
return IsValid() && other.major_version == major_version &&
other.minor_version == minor_version;
}
}
}
} // namespace util
} // namespace osrm
+12 -12
View File
@@ -17,9 +17,9 @@ NodeIdVectorToLineString::NodeIdVectorToLineString(
}
// converts a vector of node ids into a linestring geojson feature
util::json::Object NodeIdVectorToLineString::
operator()(const std::vector<NodeID> &node_ids,
const boost::optional<json::Object> &properties) const
util::json::Object
NodeIdVectorToLineString::operator()(const std::vector<NodeID> &node_ids,
const boost::optional<json::Object> &properties) const
{
util::json::Array coordinates;
std::transform(node_ids.begin(),
@@ -37,9 +37,9 @@ NodeIdVectorToMultiPoint::NodeIdVectorToMultiPoint(
{
}
util::json::Object NodeIdVectorToMultiPoint::
operator()(const std::vector<NodeID> &node_ids,
const boost::optional<json::Object> &properties) const
util::json::Object
NodeIdVectorToMultiPoint::operator()(const std::vector<NodeID> &node_ids,
const boost::optional<json::Object> &properties) const
{
util::json::Array coordinates;
std::transform(node_ids.begin(),
@@ -51,18 +51,18 @@ operator()(const std::vector<NodeID> &node_ids,
}
//----------------------------------------------------------------
util::json::Object CoordinateVectorToMultiPoint::
operator()(const std::vector<util::Coordinate> &input_coordinates,
const boost::optional<json::Object> &properties) const
util::json::Object
CoordinateVectorToMultiPoint::operator()(const std::vector<util::Coordinate> &input_coordinates,
const boost::optional<json::Object> &properties) const
{
const auto coordinates = makeJsonArray(input_coordinates);
return makeFeature("MultiPoint", std::move(coordinates), properties);
}
//----------------------------------------------------------------
util::json::Object CoordinateVectorToLineString::
operator()(const std::vector<util::Coordinate> &input_coordinates,
const boost::optional<json::Object> &properties) const
util::json::Object
CoordinateVectorToLineString::operator()(const std::vector<util::Coordinate> &input_coordinates,
const boost::optional<json::Object> &properties) const
{
const auto coordinates = makeJsonArray(input_coordinates);
return makeFeature("LineString", std::move(coordinates), properties);
+1 -1
View File
@@ -25,7 +25,7 @@ void __throw_out_of_range_fmt(const char *err, ...)
// Safe and over-simplified version. Ignore the format and print it as-is.
__throw_out_of_range(err);
}
}
} // namespace std
#endif // _ENABLE_GLIBC_WORKAROUND
#endif // GLIBC_WORKAROUND
+3 -3
View File
@@ -22,7 +22,7 @@ static const char MAGENTA[]{"\x1b[35m"};
// static const char GREEN[] { "\x1b[32m"};
// static const char BLUE[] { "\x1b[34m"};
// static const char CYAN[] { "\x1b[36m"};
}
} // namespace
void LogPolicy::Unmute() { m_is_mute = false; }
@@ -150,5 +150,5 @@ UnbufferedLog::UnbufferedLog(LogLevel level_)
{
stream.flags(std::ios_base::unitbuf);
}
}
}
} // namespace util
} // namespace osrm
+4 -4
View File
@@ -125,7 +125,7 @@ namespace
{
namespace ph = boost::phoenix;
namespace qi = boost::spirit::qi;
}
} // namespace
template <typename Iterator, typename Skipper = qi::blank_type>
struct opening_hours_grammar : qi::grammar<Iterator, Skipper, std::vector<OpeningHours>()>
@@ -398,7 +398,7 @@ struct opening_hours_grammar : qi::grammar<Iterator, Skipper, std::vector<Openin
qi::uint_parser<unsigned, 10, 2, 2> uint2_p;
qi::uint_parser<unsigned, 10, 4, 4> uint4_p;
};
}
} // namespace detail
std::vector<OpeningHours> ParseOpeningHours(const std::string &str)
{
@@ -431,5 +431,5 @@ bool CheckOpeningHours(const std::vector<OpeningHours> &input, const struct tm &
return is_open;
}
} // util
} // osrm
} // namespace util
} // namespace osrm
+2 -2
View File
@@ -8,5 +8,5 @@ namespace detail
{
std::atomic_uint operation = {0};
}
}
}
} // namespace util
} // namespace osrm
+2 -2
View File
@@ -162,5 +162,5 @@ boost::optional<struct tm> Timezoner::operator()(const point_t &point) const
}
return boost::none;
}
}
}
} // namespace updater
} // namespace osrm