Apply clang-format again
This commit is contained in:
@@ -360,7 +360,7 @@ class InternalDataFacade final : public BaseDataFacade
|
||||
std::vector<util::guidance::BearingClass> bearing_classes;
|
||||
// and the actual bearing values
|
||||
std::uint64_t num_bearings;
|
||||
intersection_stream.read(reinterpret_cast<char*>(&num_bearings),sizeof(num_bearings));
|
||||
intersection_stream.read(reinterpret_cast<char *>(&num_bearings), sizeof(num_bearings));
|
||||
m_bearing_values_table.resize(num_bearings);
|
||||
intersection_stream.read(reinterpret_cast<char *>(&m_bearing_values_table[0]),
|
||||
sizeof(m_bearing_values_table[0]) * num_bearings);
|
||||
|
||||
@@ -840,7 +840,8 @@ class SharedDataFacade final : public BaseDataFacade
|
||||
else
|
||||
return extractor::guidance::TurnLaneDescription(
|
||||
m_lane_description_masks.begin() + m_lane_description_offsets[lane_description_id],
|
||||
m_lane_description_masks.begin() + m_lane_description_offsets[lane_description_id + 1]);
|
||||
m_lane_description_masks.begin() +
|
||||
m_lane_description_offsets[lane_description_id + 1]);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -247,7 +247,8 @@ inline std::vector<RouteStep> assembleSteps(const datafacade::BaseDataFacade &fa
|
||||
BOOST_ASSERT(steps.back().intersections.front().entry.size() == 1);
|
||||
BOOST_ASSERT(steps.back().maneuver.waypoint_type == WaypointType::Arrive);
|
||||
BOOST_ASSERT(steps.back().intersections.front().lanes.lanes_in_turn == 0);
|
||||
BOOST_ASSERT(steps.back().intersections.front().lanes.first_lane_from_the_right == INVALID_LANEID);
|
||||
BOOST_ASSERT(steps.back().intersections.front().lanes.first_lane_from_the_right ==
|
||||
INVALID_LANEID);
|
||||
BOOST_ASSERT(steps.back().intersections.front().lane_description.empty());
|
||||
return steps;
|
||||
}
|
||||
|
||||
@@ -107,12 +107,11 @@ trimLaneString(std::string lane_string, std::int32_t count_left, std::int32_t co
|
||||
return extractor::guidance::trimLaneString(std::move(lane_string), count_left, count_right);
|
||||
}
|
||||
|
||||
inline std::string
|
||||
applyAccessTokens(const std::string &lane_string, const std::string &access_tokens)
|
||||
inline std::string applyAccessTokens(const std::string &lane_string,
|
||||
const std::string &access_tokens)
|
||||
{
|
||||
return extractor::guidance::applyAccessTokens(lane_string, access_tokens);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef EXTRACTION_WAY_HPP
|
||||
#define EXTRACTION_WAY_HPP
|
||||
|
||||
#include "extractor/travel_mode.hpp"
|
||||
#include "extractor/guidance/road_classification.hpp"
|
||||
#include "extractor/travel_mode.hpp"
|
||||
#include "util/guidance/turn_lanes.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef EXTRACTOR_CALLBACKS_HPP
|
||||
#define EXTRACTOR_CALLBACKS_HPP
|
||||
|
||||
#include "util/typedefs.hpp"
|
||||
#include "extractor/guidance/turn_lane_types.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
|
||||
#include <boost/functional/hash.hpp>
|
||||
#include <boost/optional/optional_fwd.hpp>
|
||||
@@ -40,7 +40,10 @@ class ExtractorCallbacks
|
||||
using MapKey = std::pair<std::string, std::string>;
|
||||
using MapVal = unsigned;
|
||||
std::unordered_map<MapKey, MapVal, boost::hash<MapKey>> string_map;
|
||||
std::unordered_map<guidance::TurnLaneDescription,LaneDescriptionID,guidance::TurnLaneDescription_hash> lane_description_map;
|
||||
std::unordered_map<guidance::TurnLaneDescription,
|
||||
LaneDescriptionID,
|
||||
guidance::TurnLaneDescription_hash>
|
||||
lane_description_map;
|
||||
ExtractionContainers &external_memory;
|
||||
|
||||
public:
|
||||
|
||||
@@ -84,16 +84,10 @@ class RoadClassification
|
||||
bool IsLowPriorityRoadClass() const { return (0 != may_be_ignored); }
|
||||
void SetLowPriorityFlag(const bool new_value) { may_be_ignored = new_value; }
|
||||
|
||||
std::uint32_t GetPriority() const
|
||||
{
|
||||
return static_cast<std::uint32_t>(road_priority_class);
|
||||
}
|
||||
std::uint32_t GetPriority() const { return static_cast<std::uint32_t>(road_priority_class); }
|
||||
|
||||
RoadPriorityClass::Enum GetClass() const { return road_priority_class; }
|
||||
void SetClass(const RoadPriorityClass::Enum new_value)
|
||||
{
|
||||
road_priority_class = new_value;
|
||||
}
|
||||
void SetClass(const RoadPriorityClass::Enum new_value) { road_priority_class = new_value; }
|
||||
|
||||
bool operator==(const RoadClassification &other) const
|
||||
{
|
||||
@@ -102,10 +96,7 @@ class RoadClassification
|
||||
road_priority_class == other.road_priority_class;
|
||||
}
|
||||
|
||||
bool operator!=(const RoadClassification &other ) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
bool operator!=(const RoadClassification &other) const { return !(*this == other); }
|
||||
|
||||
std::string ToString() const
|
||||
{
|
||||
@@ -116,7 +107,9 @@ class RoadClassification
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
static_assert(sizeof(RoadClassification) == 1,"Road Classification should fit a byte. Increasing this has a severe impact on memory.");
|
||||
static_assert(
|
||||
sizeof(RoadClassification) == 1,
|
||||
"Road Classification should fit a byte. Increasing this has a severe impact on memory.");
|
||||
|
||||
inline bool canBeSeenAsFork(const RoadClassification first, const RoadClassification second)
|
||||
{
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#define OSRM_EXTRACTOR_GUIDANCE_SLIPROAD_HANDLER_HPP_
|
||||
|
||||
#include "extractor/guidance/intersection.hpp"
|
||||
#include "extractor/guidance/intersection_handler.hpp"
|
||||
#include "extractor/guidance/intersection_generator.hpp"
|
||||
#include "extractor/guidance/intersection_handler.hpp"
|
||||
#include "extractor/query_node.hpp"
|
||||
|
||||
#include "util/name_table.hpp"
|
||||
@@ -42,6 +42,7 @@ class SliproadHandler : public IntersectionHandler
|
||||
Intersection operator()(const NodeID nid,
|
||||
const EdgeID via_eid,
|
||||
Intersection intersection) const override final;
|
||||
|
||||
private:
|
||||
const IntersectionGenerator &intersection_generator;
|
||||
};
|
||||
|
||||
@@ -61,7 +61,8 @@ class TurnHandler : public IntersectionHandler
|
||||
handleDistinctConflict(const EdgeID via_edge, ConnectedRoad &left, ConnectedRoad &right) const;
|
||||
|
||||
// Classification
|
||||
std::pair<std::size_t, std::size_t> findFork(const EdgeID via_edge, const Intersection &intersection) const;
|
||||
std::pair<std::size_t, std::size_t> findFork(const EdgeID via_edge,
|
||||
const Intersection &intersection) const;
|
||||
|
||||
Intersection assignLeftTurns(const EdgeID via_edge,
|
||||
Intersection intersection,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef OSRM_EXTRACTOR_GUIDANCE_TURN_LANE_DATA_HPP_
|
||||
#define OSRM_EXTRACTOR_GUIDANCE_TURN_LANE_DATA_HPP_
|
||||
|
||||
#include "util/typedefs.hpp"
|
||||
#include "extractor/guidance/turn_lane_types.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/functional/hash_fwd.hpp>
|
||||
|
||||
#include "util/json_container.hpp"
|
||||
#include "util/simple_logger.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
#include "util/json_container.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
|
||||
@@ -141,7 +141,6 @@ struct InternalExtractorEdge
|
||||
return v;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -112,20 +112,19 @@ inline bool NodeBasedEdge::operator<(const NodeBasedEdge &other) const
|
||||
return source < other.source;
|
||||
}
|
||||
|
||||
inline NodeBasedEdgeWithOSM::NodeBasedEdgeWithOSM(
|
||||
OSMNodeID source,
|
||||
OSMNodeID target,
|
||||
NodeID name_id,
|
||||
EdgeWeight weight,
|
||||
bool forward,
|
||||
bool backward,
|
||||
bool roundabout,
|
||||
bool access_restricted,
|
||||
bool startpoint,
|
||||
TravelMode travel_mode,
|
||||
bool is_split,
|
||||
const LaneDescriptionID lane_description_id,
|
||||
guidance::RoadClassification road_classification)
|
||||
inline NodeBasedEdgeWithOSM::NodeBasedEdgeWithOSM(OSMNodeID source,
|
||||
OSMNodeID target,
|
||||
NodeID name_id,
|
||||
EdgeWeight weight,
|
||||
bool forward,
|
||||
bool backward,
|
||||
bool roundabout,
|
||||
bool access_restricted,
|
||||
bool startpoint,
|
||||
TravelMode travel_mode,
|
||||
bool is_split,
|
||||
const LaneDescriptionID lane_description_id,
|
||||
guidance::RoadClassification road_classification)
|
||||
: NodeBasedEdge(SPECIAL_NODEID,
|
||||
SPECIAL_NODEID,
|
||||
name_id,
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
#include "util/coordinate.hpp"
|
||||
|
||||
#include <limits>
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
@@ -15,8 +15,8 @@ namespace extractor
|
||||
|
||||
struct QueryNode
|
||||
{
|
||||
using key_type = OSMNodeID; // type of NodeID
|
||||
using value_type = std::int32_t; // type of lat,lons
|
||||
using key_type = OSMNodeID; // type of NodeID
|
||||
using value_type = std::int32_t; // type of lat,lons
|
||||
|
||||
explicit QueryNode(const util::FixedLongitude lon_,
|
||||
const util::FixedLatitude lat_,
|
||||
|
||||
@@ -48,7 +48,7 @@ class LuaScriptingEnvironment final : public ScriptingEnvironment
|
||||
explicit LuaScriptingEnvironment(const std::string &file_name);
|
||||
~LuaScriptingEnvironment() override = default;
|
||||
|
||||
const ProfileProperties& GetProfileProperties() override;
|
||||
const ProfileProperties &GetProfileProperties() override;
|
||||
|
||||
LuaScriptingContext &GetLuaContext();
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ inline void print(const std::vector<engine::guidance::RouteStep> &steps)
|
||||
}
|
||||
}
|
||||
|
||||
inline void print( const extractor::guidance::Intersection & intersection )
|
||||
inline void print(const extractor::guidance::Intersection &intersection)
|
||||
{
|
||||
std::cout << " Intersection:\n";
|
||||
for (const auto &road : intersection)
|
||||
@@ -62,7 +62,6 @@ inline void print( const extractor::guidance::Intersection & intersection )
|
||||
std::cout << std::flush;
|
||||
}
|
||||
|
||||
|
||||
inline void print(const extractor::guidance::lanes::LaneDataVector &turn_lane_data)
|
||||
{
|
||||
std::cout << " Tags:\n";
|
||||
|
||||
+1
-1
@@ -151,7 +151,7 @@ bool serializeVector(std::ofstream &out_stream, const stxxl::vector<simple_type>
|
||||
template <typename simple_type>
|
||||
bool deserializeAdjacencyArray(const std::string &filename,
|
||||
std::vector<std::uint32_t> &offsets,
|
||||
std::vector<simple_type>& data)
|
||||
std::vector<simple_type> &data)
|
||||
{
|
||||
std::ifstream in_stream(filename, std::ios::binary);
|
||||
|
||||
|
||||
@@ -192,9 +192,9 @@ class StaticRTree
|
||||
|
||||
Coordinate current_centroid = coordinate_calculation::centroid(
|
||||
m_coordinate_list[current_element.u], m_coordinate_list[current_element.v]);
|
||||
current_centroid.lat =
|
||||
FixedLatitude{static_cast<std::int32_t>(COORDINATE_PRECISION *
|
||||
web_mercator::latToY(toFloating(current_centroid.lat)))};
|
||||
current_centroid.lat = FixedLatitude{static_cast<std::int32_t>(
|
||||
COORDINATE_PRECISION *
|
||||
web_mercator::latToY(toFloating(current_centroid.lat)))};
|
||||
|
||||
current_wrapper.m_hilbert_value = hilbertCode(current_centroid);
|
||||
}
|
||||
|
||||
@@ -40,32 +40,32 @@ namespace osrm
|
||||
* etc. Also clarifies what this random "int" value is
|
||||
* being used for.
|
||||
*/
|
||||
#define OSRM_STRONG_TYPEDEF(From, To) \
|
||||
struct To final \
|
||||
{ \
|
||||
static_assert(std::is_arithmetic<From>(), ""); \
|
||||
From __value; \
|
||||
friend std::ostream &operator<<(std::ostream &stream, const To &inst); \
|
||||
\
|
||||
explicit operator From &() { return __value; } \
|
||||
explicit operator From() const { return __value; } \
|
||||
To operator+(const To rhs_) const { return To{__value + static_cast<const From>(rhs_)}; } \
|
||||
To operator-(const To rhs_) const { return To{__value - static_cast<const From>(rhs_)}; } \
|
||||
To operator*(const To rhs_) const { return To{__value * static_cast<const From>(rhs_)}; } \
|
||||
To operator/(const To rhs_) const { return To{__value / static_cast<const From>(rhs_)}; } \
|
||||
bool operator<(const To z_) const { return __value < static_cast<const From>(z_); } \
|
||||
bool operator>(const To z_) const { return __value > static_cast<const From>(z_); } \
|
||||
bool operator<=(const To z_) const { return __value <= static_cast<const From>(z_); } \
|
||||
bool operator>=(const To z_) const { return __value >= static_cast<const From>(z_); } \
|
||||
bool operator==(const To z_) const { return __value == static_cast<const From>(z_); } \
|
||||
bool operator!=(const To z_) const { return __value != static_cast<const From>(z_); } \
|
||||
}; \
|
||||
static_assert(std::is_trivial<To>(), #To " is not a trivial type"); \
|
||||
static_assert(std::is_standard_layout<To>(), #To " is not a standart layout"); \
|
||||
static_assert(std::is_pod<To>(), #To " is not a POD layout"); \
|
||||
inline std::ostream &operator<<(std::ostream &stream, const To &inst) \
|
||||
{ \
|
||||
return stream << inst.__value; \
|
||||
#define OSRM_STRONG_TYPEDEF(From, To) \
|
||||
struct To final \
|
||||
{ \
|
||||
static_assert(std::is_arithmetic<From>(), ""); \
|
||||
From __value; \
|
||||
friend std::ostream &operator<<(std::ostream &stream, const To &inst); \
|
||||
\
|
||||
explicit operator From &() { return __value; } \
|
||||
explicit operator From() const { return __value; } \
|
||||
To operator+(const To rhs_) const { return To{__value + static_cast<const From>(rhs_)}; } \
|
||||
To operator-(const To rhs_) const { return To{__value - static_cast<const From>(rhs_)}; } \
|
||||
To operator*(const To rhs_) const { return To{__value * static_cast<const From>(rhs_)}; } \
|
||||
To operator/(const To rhs_) const { return To{__value / static_cast<const From>(rhs_)}; } \
|
||||
bool operator<(const To z_) const { return __value < static_cast<const From>(z_); } \
|
||||
bool operator>(const To z_) const { return __value > static_cast<const From>(z_); } \
|
||||
bool operator<=(const To z_) const { return __value <= static_cast<const From>(z_); } \
|
||||
bool operator>=(const To z_) const { return __value >= static_cast<const From>(z_); } \
|
||||
bool operator==(const To z_) const { return __value == static_cast<const From>(z_); } \
|
||||
bool operator!=(const To z_) const { return __value != static_cast<const From>(z_); } \
|
||||
}; \
|
||||
static_assert(std::is_trivial<To>(), #To " is not a trivial type"); \
|
||||
static_assert(std::is_standard_layout<To>(), #To " is not a standart layout"); \
|
||||
static_assert(std::is_pod<To>(), #To " is not a POD layout"); \
|
||||
inline std::ostream &operator<<(std::ostream &stream, const To &inst) \
|
||||
{ \
|
||||
return stream << inst.__value; \
|
||||
}
|
||||
|
||||
#define OSRM_STRONG_TYPEDEF_HASHABLE(From, To) \
|
||||
|
||||
@@ -64,7 +64,8 @@ static const LaneID INVALID_LANEID = std::numeric_limits<LaneID>::max();
|
||||
using LaneDataID = std::uint16_t;
|
||||
static const LaneDataID INVALID_LANE_DATAID = std::numeric_limits<LaneDataID>::max();
|
||||
using LaneDescriptionID = std::uint16_t;
|
||||
static const LaneDescriptionID INVALID_LANE_DESCRIPTIONID = std::numeric_limits<LaneDescriptionID>::max();
|
||||
static const LaneDescriptionID INVALID_LANE_DESCRIPTIONID =
|
||||
std::numeric_limits<LaneDescriptionID>::max();
|
||||
|
||||
using BearingClassID = std::uint32_t;
|
||||
static const BearingClassID INVALID_BEARING_CLASSID = std::numeric_limits<BearingClassID>::max();
|
||||
|
||||
Reference in New Issue
Block a user