Second round of formatting
This commit is contained in:
parent
a59ce85fd0
commit
d1632f5021
@ -15,8 +15,8 @@ struct QueryEdge
|
||||
struct EdgeData
|
||||
{
|
||||
explicit EdgeData()
|
||||
: turn_id(0), shortcut(false), weight{0}, duration(0), forward(false), backward(false),
|
||||
distance{0}
|
||||
: turn_id(0), shortcut(false), weight{0}, duration(0), forward(false),
|
||||
backward(false), distance{0}
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -72,8 +72,9 @@ class BaseAPI
|
||||
std::transform(candidates.begin(),
|
||||
candidates.end(),
|
||||
seg_hints.begin(),
|
||||
[this](const auto &phantom)
|
||||
{ return SegmentHint{phantom, facade.GetCheckSum()}; });
|
||||
[this](const auto &phantom) {
|
||||
return SegmentHint{phantom, facade.GetCheckSum()};
|
||||
});
|
||||
|
||||
return json::makeWaypoint(
|
||||
snapped_location,
|
||||
@ -141,8 +142,9 @@ class BaseAPI
|
||||
std::transform(candidates.begin(),
|
||||
candidates.end(),
|
||||
seg_hints.begin(),
|
||||
[this](const auto &phantom)
|
||||
{ return SegmentHint{phantom, facade.GetCheckSum()}; });
|
||||
[this](const auto &phantom) {
|
||||
return SegmentHint{phantom, facade.GetCheckSum()};
|
||||
});
|
||||
Hint hint{std::move(seg_hints)};
|
||||
hint_string = builder->CreateString(hint.ToBase64());
|
||||
}
|
||||
|
@ -78,8 +78,9 @@ struct MatchParameters : public RouteParameters
|
||||
bool tidy_,
|
||||
const std::vector<std::size_t> &waypoints_,
|
||||
Args &&...args_)
|
||||
: RouteParameters{std::forward<Args>(args_)..., waypoints_},
|
||||
timestamps{std::move(timestamps_)}, gaps(gaps_), tidy(tidy_)
|
||||
: RouteParameters{std::forward<Args>(args_)..., waypoints_}, timestamps{std::move(
|
||||
timestamps_)},
|
||||
gaps(gaps_), tidy(tidy_)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -141,8 +141,8 @@ struct RouteParameters : public BaseParameters
|
||||
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
|
||||
number_of_alternatives{alternatives_ ? 1u : 0u}, annotations{annotations_},
|
||||
annotations_type{annotations_ ? AnnotationsType::All : AnnotationsType::None},
|
||||
geometries{geometries_}, overview{overview_}, continue_straight{continue_straight_},
|
||||
waypoints{std::move(waypoints_)}
|
||||
geometries{geometries_}, overview{overview_},
|
||||
continue_straight{continue_straight_}, waypoints{std::move(waypoints_)}
|
||||
{
|
||||
}
|
||||
|
||||
@ -157,10 +157,10 @@ struct RouteParameters : public BaseParameters
|
||||
std::vector<std::size_t> waypoints_,
|
||||
Args &&...args_)
|
||||
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
|
||||
number_of_alternatives{alternatives_ ? 1u : 0u},
|
||||
annotations{annotations_ != AnnotationsType::None}, annotations_type{annotations_},
|
||||
geometries{geometries_}, overview{overview_}, continue_straight{continue_straight_},
|
||||
waypoints{std::move(waypoints_)}
|
||||
number_of_alternatives{alternatives_ ? 1u : 0u}, annotations{annotations_ !=
|
||||
AnnotationsType::None},
|
||||
annotations_type{annotations_}, geometries{geometries_}, overview{overview_},
|
||||
continue_straight{continue_straight_}, waypoints{std::move(waypoints_)}
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -61,8 +61,8 @@ struct TripParameters : public RouteParameters
|
||||
DestinationType destination_,
|
||||
bool roundtrip_,
|
||||
Args &&...args_)
|
||||
: RouteParameters{std::forward<Args>(args_)...}, source{source_}, destination{destination_},
|
||||
roundtrip{roundtrip_}
|
||||
: RouteParameters{std::forward<Args>(args_)...}, source{source_},
|
||||
destination{destination_}, roundtrip{roundtrip_}
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -44,15 +44,16 @@ namespace osrm::engine
|
||||
struct PhantomNode
|
||||
{
|
||||
PhantomNode()
|
||||
: forward_segment_id{SPECIAL_SEGMENTID, false},
|
||||
reverse_segment_id{SPECIAL_SEGMENTID, false}, forward_weight(INVALID_EDGE_WEIGHT),
|
||||
: forward_segment_id{SPECIAL_SEGMENTID, false}, reverse_segment_id{SPECIAL_SEGMENTID,
|
||||
false},
|
||||
forward_weight(INVALID_EDGE_WEIGHT),
|
||||
reverse_weight(INVALID_EDGE_WEIGHT), forward_weight_offset{0}, reverse_weight_offset{0},
|
||||
forward_distance(INVALID_EDGE_DISTANCE), reverse_distance(INVALID_EDGE_DISTANCE),
|
||||
forward_distance_offset{0}, reverse_distance_offset{0},
|
||||
forward_duration(MAXIMAL_EDGE_DURATION), reverse_duration(MAXIMAL_EDGE_DURATION),
|
||||
forward_duration_offset{0}, reverse_duration_offset{0},
|
||||
component({INVALID_COMPONENTID, 0}), fwd_segment_position(0),
|
||||
is_valid_forward_source{false}, is_valid_forward_target{false},
|
||||
component({INVALID_COMPONENTID, 0}),
|
||||
fwd_segment_position(0), is_valid_forward_source{false}, is_valid_forward_target{false},
|
||||
is_valid_reverse_source{false}, is_valid_reverse_target{false}, bearing(0)
|
||||
|
||||
{
|
||||
|
@ -18,8 +18,9 @@ namespace osrm::extractor
|
||||
struct EdgeBasedNodeSegment
|
||||
{
|
||||
EdgeBasedNodeSegment()
|
||||
: forward_segment_id{SPECIAL_SEGMENTID, false},
|
||||
reverse_segment_id{SPECIAL_SEGMENTID, false}, u(SPECIAL_NODEID), v(SPECIAL_NODEID),
|
||||
: forward_segment_id{SPECIAL_SEGMENTID, false}, reverse_segment_id{SPECIAL_SEGMENTID,
|
||||
false},
|
||||
u(SPECIAL_NODEID), v(SPECIAL_NODEID),
|
||||
fwd_segment_position(std::numeric_limits<unsigned short>::max() >>
|
||||
1), // >> 1 because we've only got 15 bits
|
||||
is_startpoint(false)
|
||||
|
@ -105,7 +105,9 @@ std::vector<BisectionInputEdge> adaptToBisectionEdge(std::vector<InputEdge> edge
|
||||
std::transform(begin(edges),
|
||||
end(edges),
|
||||
std::back_inserter(result),
|
||||
[](const auto &edge) { return BisectionInputEdge{edge.source, edge.target}; });
|
||||
[](const auto &edge) {
|
||||
return BisectionInputEdge{edge.source, edge.target};
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -189,10 +189,10 @@ template <storage::Ownership Ownership> class CellStorageImpl
|
||||
const NodeID *const all_sources,
|
||||
const NodeID *const all_destinations)
|
||||
: num_source_nodes{data.num_source_nodes},
|
||||
num_destination_nodes{data.num_destination_nodes},
|
||||
weights{all_weights + data.value_offset},
|
||||
durations{all_durations + data.value_offset},
|
||||
distances{all_distances + data.value_offset},
|
||||
num_destination_nodes{data.num_destination_nodes}, weights{all_weights +
|
||||
data.value_offset},
|
||||
durations{all_durations + data.value_offset}, distances{all_distances +
|
||||
data.value_offset},
|
||||
source_boundary{all_sources + data.source_boundary_offset},
|
||||
destination_boundary{all_destinations + data.destination_boundary_offset}
|
||||
{
|
||||
@ -210,8 +210,8 @@ template <storage::Ownership Ownership> class CellStorageImpl
|
||||
const NodeID *const all_destinations)
|
||||
: num_source_nodes{data.num_source_nodes},
|
||||
num_destination_nodes{data.num_destination_nodes}, weights{nullptr},
|
||||
durations{nullptr}, distances{nullptr},
|
||||
source_boundary{all_sources + data.source_boundary_offset},
|
||||
durations{nullptr}, distances{nullptr}, source_boundary{all_sources +
|
||||
data.source_boundary_offset},
|
||||
destination_boundary{all_destinations + data.destination_boundary_offset}
|
||||
{
|
||||
BOOST_ASSERT(num_source_nodes == 0 || all_sources != nullptr);
|
||||
|
@ -164,7 +164,8 @@ graphToEdges(const DynamicEdgeBasedGraph &edge_based_graph)
|
||||
[](const NodeID lhs, const NodeID rhs) { return std::max(lhs, rhs); });
|
||||
|
||||
std::vector<extractor::EdgeBasedEdge> edges(max_turn_id + 1);
|
||||
tbb::parallel_for(range,
|
||||
tbb::parallel_for(
|
||||
range,
|
||||
[&](const auto range)
|
||||
{
|
||||
for (auto node = range.begin(); node < range.end(); ++node)
|
||||
@ -178,8 +179,7 @@ graphToEdges(const DynamicEdgeBasedGraph &edge_based_graph)
|
||||
{
|
||||
auto target = edge_based_graph.GetTarget(edge);
|
||||
BOOST_ASSERT(data.turn_id <= max_turn_id);
|
||||
edges[data.turn_id] =
|
||||
extractor::EdgeBasedEdge{node, target, data};
|
||||
edges[data.turn_id] = extractor::EdgeBasedEdge{node, target, data};
|
||||
// only save the forward edge
|
||||
edges[data.turn_id].data.forward = true;
|
||||
edges[data.turn_id].data.backward = false;
|
||||
|
@ -110,9 +110,10 @@ struct BaseParametersGrammar : boost::spirit::qi::grammar<Iterator, Signature>
|
||||
unlimited_rule = qi::lit("unlimited")[qi::_val = std::numeric_limits<double>::infinity()];
|
||||
|
||||
bearing_rule =
|
||||
(qi::short_ > ',' >
|
||||
qi::short_)[qi::_val = ph::bind([](short bearing, short range)
|
||||
{ return osrm::engine::Bearing{bearing, range}; },
|
||||
(qi::short_ > ',' > qi::short_)[qi::_val = ph::bind(
|
||||
[](short bearing, short range) {
|
||||
return osrm::engine::Bearing{bearing, range};
|
||||
},
|
||||
qi::_1,
|
||||
qi::_2)];
|
||||
|
||||
|
@ -267,7 +267,9 @@ template <typename ElementT> class DeallocatingVector
|
||||
++current_size;
|
||||
}
|
||||
|
||||
void reserve(const std::size_t) const { /* don't do anything */ }
|
||||
void reserve(const std::size_t) const
|
||||
{ /* don't do anything */
|
||||
}
|
||||
|
||||
void resize(const std::size_t new_size)
|
||||
{
|
||||
|
@ -1183,8 +1183,9 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges(
|
||||
first_turn_edges.first,
|
||||
first_turn_edges.second,
|
||||
std::back_inserter(node_sequences),
|
||||
[](const auto turn_edges)
|
||||
{ return std::vector<NodeID>{turn_edges.second.first, turn_edges.second.second}; });
|
||||
[](const auto turn_edges) {
|
||||
return std::vector<NodeID>{turn_edges.second.first, turn_edges.second.second};
|
||||
});
|
||||
|
||||
std::for_each(std::next(turns.begin()),
|
||||
turns.end(),
|
||||
|
Loading…
Reference in New Issue
Block a user