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:
@@ -16,14 +16,14 @@ namespace ch
|
||||
struct Algorithm final
|
||||
{
|
||||
};
|
||||
}
|
||||
} // namespace ch
|
||||
// Multi-Level Dijkstra
|
||||
namespace mld
|
||||
{
|
||||
struct Algorithm final
|
||||
{
|
||||
};
|
||||
}
|
||||
} // namespace mld
|
||||
|
||||
// Algorithm names
|
||||
template <typename AlgorithmT> const char *name();
|
||||
@@ -111,8 +111,8 @@ template <> struct HasGetTileTurns<mld::Algorithm> final : std::true_type
|
||||
template <> struct HasExcludeFlags<mld::Algorithm> final : std::true_type
|
||||
{
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace routing_algorithms
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -128,8 +128,8 @@ class BaseAPI
|
||||
const BaseParameters ¶meters;
|
||||
};
|
||||
|
||||
} // ns api
|
||||
} // ns engine
|
||||
} // ns osrm
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -124,8 +124,8 @@ struct BaseParameters
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif // ROUTE_PARAMETERS_HPP
|
||||
|
||||
@@ -16,8 +16,8 @@ namespace api
|
||||
{
|
||||
using ResultT =
|
||||
mapbox::util::variant<util::json::Object, std::string, flatbuffers::FlatBufferBuilder>;
|
||||
} // ns api
|
||||
} // ns engine
|
||||
} // ns osrm
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -112,8 +112,8 @@ util::json::Object makeRouteLeg(guidance::RouteLeg leg, util::json::Array steps)
|
||||
util::json::Array makeRouteLegs(std::vector<guidance::RouteLeg> legs,
|
||||
std::vector<util::json::Value> step_geometries,
|
||||
std::vector<util::json::Object> annotations);
|
||||
}
|
||||
}
|
||||
} // namespace json
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
|
||||
@@ -248,8 +248,8 @@ class MatchAPI final : public RouteAPI
|
||||
const tidy::Result &tidy_result;
|
||||
};
|
||||
|
||||
} // ns api
|
||||
} // ns engine
|
||||
} // ns osrm
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -79,8 +79,9 @@ struct MatchParameters : public RouteParameters
|
||||
bool tidy_,
|
||||
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_)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -94,8 +95,8 @@ struct MatchParameters : public RouteParameters
|
||||
(timestamps.empty() || timestamps.size() == coordinates.size());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -200,9 +200,9 @@ inline Result tidy(const MatchParameters ¶ms, Thresholds cfg = {15., 5})
|
||||
return result;
|
||||
}
|
||||
|
||||
} // ns tidy
|
||||
} // ns api
|
||||
} // ns engine
|
||||
} // ns osrm
|
||||
} // namespace tidy
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -159,8 +159,8 @@ class NearestAPI final : public BaseAPI
|
||||
}
|
||||
};
|
||||
|
||||
} // ns api
|
||||
} // ns engine
|
||||
} // ns osrm
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -52,8 +52,8 @@ struct NearestParameters : public BaseParameters
|
||||
|
||||
bool IsValid() const { return BaseParameters::IsValid() && number_of_results >= 1; }
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif // ENGINE_API_NEAREST_PARAMETERS_HPP
|
||||
|
||||
@@ -988,8 +988,8 @@ class RouteAPI : public BaseAPI
|
||||
}
|
||||
};
|
||||
|
||||
} // ns api
|
||||
} // ns engine
|
||||
} // ns osrm
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -90,16 +90,10 @@ struct RouteParameters : public BaseParameters
|
||||
Args... args_)
|
||||
// Once we perfectly-forward `args` (see #2990) this constructor can delegate to the one
|
||||
// below.
|
||||
: BaseParameters{std::forward<Args>(args_)...},
|
||||
steps{steps_},
|
||||
alternatives{alternatives_},
|
||||
number_of_alternatives{alternatives_ ? 1u : 0u},
|
||||
annotations{false},
|
||||
annotations_type{AnnotationsType::None},
|
||||
geometries{geometries_},
|
||||
overview{overview_},
|
||||
continue_straight{continue_straight_},
|
||||
waypoints()
|
||||
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
|
||||
number_of_alternatives{alternatives_ ? 1u : 0u}, annotations{false},
|
||||
annotations_type{AnnotationsType::None}, geometries{geometries_}, overview{overview_},
|
||||
continue_straight{continue_straight_}, waypoints()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -151,8 +145,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{waypoints_}
|
||||
geometries{geometries_}, overview{overview_},
|
||||
continue_straight{continue_straight_}, waypoints{waypoints_}
|
||||
{
|
||||
}
|
||||
|
||||
@@ -217,8 +211,8 @@ inline RouteParameters::AnnotationsType operator|=(RouteParameters::AnnotationsT
|
||||
{
|
||||
return lhs = lhs | rhs;
|
||||
}
|
||||
} // ns api
|
||||
} // ns engine
|
||||
} // ns osrm
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -407,8 +407,8 @@ class TableAPI final : public BaseAPI
|
||||
const TableParameters ¶meters;
|
||||
};
|
||||
|
||||
} // ns api
|
||||
} // ns engine
|
||||
} // ns osrm
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -166,8 +166,8 @@ inline TableParameters::AnnotationsType &operator|=(TableParameters::Annotations
|
||||
{
|
||||
return lhs = lhs | rhs;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif // ENGINE_API_TABLE_PARAMETERS_HPP
|
||||
|
||||
@@ -70,8 +70,8 @@ struct TileParameters final
|
||||
return valid_x && valid_y && valid_z;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -175,8 +175,8 @@ class TripAPI final : public RouteAPI
|
||||
const TripParameters ¶meters;
|
||||
};
|
||||
|
||||
} // ns api
|
||||
} // ns engine
|
||||
} // ns osrm
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -65,8 +65,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_}
|
||||
{
|
||||
}
|
||||
|
||||
@@ -76,8 +76,8 @@ struct TripParameters : public RouteParameters
|
||||
|
||||
bool IsValid() const { return RouteParameters::IsValid(); }
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -42,5 +42,5 @@ enum class Approach : std::uint8_t
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace osrm
|
||||
#endif
|
||||
|
||||
@@ -38,7 +38,7 @@ using BinaryFromBase64 = boost::archive::iterators::transform_width<
|
||||
8, // get a view of 8 bit
|
||||
6 // from a sequence of 6 bit
|
||||
>;
|
||||
} // ns detail
|
||||
} // namespace detail
|
||||
namespace engine
|
||||
{
|
||||
|
||||
@@ -135,7 +135,7 @@ template <typename T> T decodeBase64Bytewise(const std::string &encoded)
|
||||
return x;
|
||||
}
|
||||
|
||||
} // ns engine
|
||||
} // ns osrm
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif /* OSRM_BASE64_HPP */
|
||||
|
||||
@@ -46,7 +46,7 @@ inline bool operator==(const Bearing lhs, const Bearing rhs)
|
||||
return lhs.bearing == rhs.bearing && lhs.range == rhs.range;
|
||||
}
|
||||
inline bool operator!=(const Bearing lhs, const Bearing rhs) { return !(lhs == rhs); }
|
||||
}
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -142,14 +142,14 @@ class DataWatchdogImpl<AlgorithmT, datafacade::ContiguousInternalMemoryDataFacad
|
||||
storage::SharedRegion *updatable_shared_region;
|
||||
DataFacadeFactory<datafacade::ContiguousInternalMemoryDataFacade, AlgorithmT> facade_factory;
|
||||
};
|
||||
}
|
||||
} // namespace detail
|
||||
|
||||
// This class monitors the shared memory region that contains the pointers to
|
||||
// the data and layout regions that should be used. This region is updated
|
||||
// once a new dataset arrives.
|
||||
template <typename AlgorithmT, template <typename A> class FacadeT>
|
||||
using DataWatchdog = detail::DataWatchdogImpl<AlgorithmT, FacadeT<AlgorithmT>>;
|
||||
}
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace engine
|
||||
using DataFacadeBase = datafacade::ContiguousInternalMemoryDataFacadeBase;
|
||||
template <typename AlgorithmT>
|
||||
using DataFacade = datafacade::ContiguousInternalMemoryDataFacade<AlgorithmT>;
|
||||
}
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -99,8 +99,8 @@ template <> class AlgorithmDataFacade<MLD>
|
||||
// searches for a specific edge
|
||||
virtual EdgeID FindEdge(const NodeID from, const NodeID to) const = 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace datafacade
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -609,7 +609,7 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
||||
auto found_range = std::equal_range(
|
||||
m_maneuver_overrides.begin(), m_maneuver_overrides.end(), edge_based_node_id, Comp{});
|
||||
|
||||
std::for_each(found_range.first, found_range.second, [&](const auto & override) {
|
||||
std::for_each(found_range.first, found_range.second, [&](const auto &override) {
|
||||
std::vector<NodeID> sequence(
|
||||
m_maneuver_override_node_sequences.begin() + override.node_sequence_offset_begin,
|
||||
m_maneuver_override_node_sequences.begin() + override.node_sequence_offset_end);
|
||||
@@ -760,8 +760,8 @@ class ContiguousInternalMemoryDataFacade<MLD> final
|
||||
{
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace datafacade
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif // CONTIGUOUS_INTERNALMEM_DATAFACADE_HPP
|
||||
|
||||
@@ -223,8 +223,8 @@ class BaseDataFacade
|
||||
virtual std::vector<extractor::ManeuverOverride>
|
||||
GetOverridesThatStartAt(const NodeID edge_based_node_id) const = 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace datafacade
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif // DATAFACADE_BASE_HPP
|
||||
|
||||
@@ -152,7 +152,7 @@ template <template <typename A> class FacadeT, typename AlgorithmT> class DataFa
|
||||
std::unordered_map<std::string, extractor::ClassData> name_to_class;
|
||||
const extractor::ProfileProperties *properties = nullptr;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -93,7 +93,7 @@ class WatchingProvider : public DataFacadeProvider<AlgorithmT, FacadeT>
|
||||
return watchdog.Get(params);
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace detail
|
||||
|
||||
template <typename AlgorithmT>
|
||||
using DataFacadeProvider = detail::DataFacadeProvider<AlgorithmT, DataFacade>;
|
||||
@@ -103,7 +103,7 @@ template <typename AlgorithmT>
|
||||
using ImmutableProvider = detail::ImmutableProvider<AlgorithmT, DataFacade>;
|
||||
template <typename AlgorithmT>
|
||||
using ExternalProvider = detail::ExternalProvider<AlgorithmT, DataFacade>;
|
||||
}
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -57,7 +57,7 @@ const constexpr std::uint64_t DOUGLAS_PEUCKER_THRESHOLDS[19] = {
|
||||
|
||||
const constexpr auto DOUGLAS_PEUCKER_THRESHOLDS_SIZE =
|
||||
sizeof(DOUGLAS_PEUCKER_THRESHOLDS) / sizeof(*DOUGLAS_PEUCKER_THRESHOLDS);
|
||||
} // ns detail
|
||||
} // namespace detail
|
||||
|
||||
// These functions compute the bitvector of indicating generalized input
|
||||
// points according to the (Ramer-)Douglas-Peucker algorithm.
|
||||
@@ -75,7 +75,7 @@ inline std::vector<util::Coordinate> douglasPeucker(const std::vector<util::Coor
|
||||
{
|
||||
return douglasPeucker(begin(geometry), end(geometry), zoom_level);
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif /* DOUGLAS_PEUCKER_HPP_ */
|
||||
|
||||
@@ -130,7 +130,7 @@ template <typename Algorithm> class Engine final : public EngineInterface
|
||||
const plugins::MatchPlugin match_plugin;
|
||||
const plugins::TilePlugin tile_plugin;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif // OSRM_IMPL_HPP
|
||||
|
||||
@@ -94,7 +94,7 @@ struct EngineConfig final
|
||||
std::string verbosity;
|
||||
std::string dataset_name;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif // SERVER_CONFIG_HPP
|
||||
|
||||
@@ -715,7 +715,7 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
|
||||
const CoordinateList &coordinates;
|
||||
DataFacadeT &datafacade;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -167,8 +167,8 @@ inline LegGeometry assembleGeometry(const datafacade::BaseDataFacade &facade,
|
||||
|
||||
return geometry;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace guidance
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -122,7 +122,7 @@ std::array<std::uint32_t, SegmentNumber> summarizeRoute(const datafacade::BaseDa
|
||||
[](const NamedSegment &segment) { return segment.name_id; });
|
||||
return summary;
|
||||
}
|
||||
}
|
||||
} // namespace detail
|
||||
|
||||
inline RouteLeg assembleLeg(const datafacade::BaseDataFacade &facade,
|
||||
const std::vector<PathData> &route_data,
|
||||
|
||||
@@ -35,7 +35,7 @@ std::pair<short, short> getDepartBearings(const LegGeometry &leg_geometry,
|
||||
std::pair<short, short> getArriveBearings(const LegGeometry &leg_geometry,
|
||||
const PhantomNode &target_node,
|
||||
const bool traversed_in_reverse);
|
||||
} // ns detail
|
||||
} // namespace detail
|
||||
|
||||
inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &facade,
|
||||
const std::vector<PathData> &leg_data,
|
||||
|
||||
@@ -163,7 +163,7 @@ void combineRouteSteps(RouteStep &step_at_turn_location,
|
||||
void suppressStep(RouteStep &step_at_turn_location, RouteStep &step_after_turn_location);
|
||||
|
||||
} /* namespace guidance */
|
||||
} /* namespace osrm */
|
||||
} // namespace engine
|
||||
} /* namespace osrm */
|
||||
|
||||
#endif /* OSRM_ENGINE_GUIDANCE_COLLAPSE_HPP_ */
|
||||
|
||||
@@ -64,8 +64,8 @@ struct LegGeometry
|
||||
return segment_offsets.size() - 1;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace guidance
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -14,8 +14,8 @@ struct Route
|
||||
double duration;
|
||||
double weight;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace guidance
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,8 +23,8 @@ struct RouteLeg
|
||||
std::string summary;
|
||||
std::vector<RouteStep> steps;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace guidance
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -46,5 +46,5 @@ inline StepManeuver getInvalidStepManeuver()
|
||||
|
||||
} // namespace guidance
|
||||
} // namespace engine
|
||||
} // namespace osrmn
|
||||
} // namespace osrm
|
||||
#endif
|
||||
|
||||
@@ -67,7 +67,7 @@ static_assert(sizeof(Hint) == 80 + 4, "Hint is bigger than expected");
|
||||
constexpr std::size_t ENCODED_HINT_SIZE = 112;
|
||||
static_assert(ENCODED_HINT_SIZE / 4 * 3 >= sizeof(Hint),
|
||||
"ENCODED_HINT_SIZE does not match size of Hint");
|
||||
}
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -173,7 +173,7 @@ inline InternalRouteResult CollapseInternalRouteResult(const InternalRouteResult
|
||||
collapsed.unpacked_path_segments.size());
|
||||
return collapsed;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif // RAW_ROUTE_DATA_H
|
||||
|
||||
@@ -98,8 +98,8 @@ class BayesClassifier
|
||||
double positive_apriori_probability;
|
||||
double negative_apriori_probability;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace map_matching
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif // BAYES_CLASSIFIER_HPP
|
||||
|
||||
@@ -137,8 +137,8 @@ template <class CandidateLists> struct HiddenMarkovModel
|
||||
return initial_timestamp;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace map_matching
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif // HIDDEN_MARKOV_MODEL
|
||||
|
||||
@@ -51,8 +51,8 @@ struct MatchingConfidence
|
||||
private:
|
||||
ClassifierT classifier;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace map_matching
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -19,8 +19,8 @@ struct SubMatching
|
||||
std::vector<unsigned> alternatives_count;
|
||||
double confidence;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace map_matching
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -44,14 +44,15 @@ namespace engine
|
||||
struct PhantomNode
|
||||
{
|
||||
PhantomNode()
|
||||
: 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_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), fwd_segment_position(0),
|
||||
is_valid_forward_source{false}, is_valid_forward_target{false},
|
||||
forward_duration_offset(0), reverse_duration_offset(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)
|
||||
|
||||
{
|
||||
@@ -109,8 +110,9 @@ struct PhantomNode
|
||||
|
||||
bool IsValid(const unsigned number_of_nodes) const
|
||||
{
|
||||
return location.IsValid() && ((forward_segment_id.id < number_of_nodes) ||
|
||||
(reverse_segment_id.id < number_of_nodes)) &&
|
||||
return location.IsValid() &&
|
||||
((forward_segment_id.id < number_of_nodes) ||
|
||||
(reverse_segment_id.id < number_of_nodes)) &&
|
||||
((forward_weight != INVALID_EDGE_WEIGHT) ||
|
||||
(reverse_weight != INVALID_EDGE_WEIGHT)) &&
|
||||
((forward_duration != MAXIMAL_EDGE_DURATION) ||
|
||||
@@ -234,7 +236,7 @@ struct PhantomNodes
|
||||
PhantomNode source_phantom;
|
||||
PhantomNode target_phantom;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif // PHANTOM_NODES_H
|
||||
|
||||
@@ -38,8 +38,8 @@ class MatchPlugin : public BasePlugin
|
||||
const int max_locations_map_matching;
|
||||
const double max_radius_map_matching;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace plugins
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif // MATCH_HPP
|
||||
|
||||
@@ -26,8 +26,8 @@ class NearestPlugin final : public BasePlugin
|
||||
private:
|
||||
const int max_results;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace plugins
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif /* NEAREST_HPP */
|
||||
|
||||
@@ -131,8 +131,10 @@ class BasePlugin
|
||||
return phantom_pair.first;
|
||||
};
|
||||
|
||||
const auto use_closed_phantom = [](
|
||||
const std::pair<PhantomNode, PhantomNode> &phantom_pair) { return phantom_pair.first; };
|
||||
const auto use_closed_phantom =
|
||||
[](const std::pair<PhantomNode, PhantomNode> &phantom_pair) {
|
||||
return phantom_pair.first;
|
||||
};
|
||||
|
||||
const bool every_phantom_is_in_tiny_cc = std::all_of(std::begin(phantom_node_pair_list),
|
||||
std::end(phantom_node_pair_list),
|
||||
@@ -388,8 +390,8 @@ class BasePlugin
|
||||
std::to_string(missing_index);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace plugins
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif /* BASE_PLUGIN_HPP */
|
||||
|
||||
@@ -27,8 +27,8 @@ class TablePlugin final : public BasePlugin
|
||||
private:
|
||||
const int max_locations_distance_table;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace plugins
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif // TABLE_HPP
|
||||
|
||||
@@ -30,8 +30,8 @@ class TilePlugin final : public BasePlugin
|
||||
const api::TileParameters ¶meters,
|
||||
osrm::engine::api::ResultT &pbf_buffer) const;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace plugins
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif /* TILEPLUGIN_HPP */
|
||||
|
||||
@@ -42,8 +42,8 @@ class TripPlugin final : public BasePlugin
|
||||
const api::TripParameters ¶meters,
|
||||
osrm::engine::api::ResultT &json_result) const;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace plugins
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif // TRIP_HPP
|
||||
|
||||
@@ -35,8 +35,8 @@ class ViaRoutePlugin final : public BasePlugin
|
||||
const api::RouteParameters &route_parameters,
|
||||
osrm::engine::api::ResultT &json_result) const;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace plugins
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif // VIA_ROUTE_HPP
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace detail
|
||||
std::string encode(std::vector<int> &numbers);
|
||||
std::int32_t decode_polyline_integer(std::string::const_iterator &first,
|
||||
std::string::const_iterator last);
|
||||
}
|
||||
} // namespace detail
|
||||
using CoordVectorForwardIter = std::vector<util::Coordinate>::const_iterator;
|
||||
// Encodes geometry into polyline format.
|
||||
// See: https://developers.google.com/maps/documentation/utilities/polylinealgorithm
|
||||
@@ -80,7 +80,7 @@ std::vector<util::Coordinate> decodePolyline(const std::string &polyline)
|
||||
}
|
||||
return coordinates;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif /* POLYLINECOMPRESSOR_H_ */
|
||||
|
||||
@@ -230,7 +230,7 @@ inline std::vector<routing_algorithms::TurnData> RoutingAlgorithms<Algorithm>::G
|
||||
return routing_algorithms::getTileTurns(*facade, edges, sorted_edge_indexes);
|
||||
}
|
||||
|
||||
} // ns engine
|
||||
} // ns osrm
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -97,7 +97,6 @@ inline LevelID getNodeQueryLevel(const MultiLevelPartition &partition,
|
||||
const std::vector<std::size_t> &phantom_indices)
|
||||
{
|
||||
auto min_level = [&partition, node](const PhantomNode &phantom_node) {
|
||||
|
||||
const auto &forward_segment = phantom_node.forward_segment_id;
|
||||
const auto forward_level =
|
||||
forward_segment.enabled ? partition.GetHighestDifferentLevel(node, forward_segment.id)
|
||||
@@ -120,7 +119,7 @@ inline LevelID getNodeQueryLevel(const MultiLevelPartition &partition,
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
// Heaps only record for each node its predecessor ("parent") on the shortest path.
|
||||
// For re-constructing the actual path we need to trace back all parent "pointers".
|
||||
|
||||
@@ -226,7 +226,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>
|
||||
InternalRouteResult shortestPathSearch(SearchEngineData<Algorithm> &engine_working_data,
|
||||
|
||||
@@ -120,7 +120,7 @@ template <> struct SearchEngineData<routing_algorithms::mld::Algorithm>
|
||||
void InitializeOrClearManyToManyThreadLocalStorage(unsigned number_of_nodes,
|
||||
unsigned number_of_boundary_nodes);
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif // SEARCH_ENGINE_DATA_HPP
|
||||
|
||||
@@ -42,7 +42,7 @@ enum class Status
|
||||
Ok,
|
||||
Error
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -92,8 +92,8 @@ std::vector<NodeID> NearestNeighbourTrip(const NodeIDIterator &start,
|
||||
}
|
||||
return route;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace trip
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif // TRIP_NEAREST_NEIGHBOUR_HPP
|
||||
|
||||
Reference in New Issue
Block a user