Apply clang-format again

This commit is contained in:
Patrick Niklaus 2016-07-26 15:00:58 +02:00
parent aebf6fa0b1
commit c7a1576100
No known key found for this signature in database
GPG Key ID: E426891B5F978B1B
42 changed files with 150 additions and 137 deletions

View File

@ -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);

View File

@ -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]);
}
};
}

View File

@ -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;
}

View File

@ -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);
}
}
}

View File

@ -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"

View File

@ -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:

View File

@ -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)
{

View File

@ -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;
};

View File

@ -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,

View File

@ -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>

View File

@ -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
{

View File

@ -141,7 +141,6 @@ struct InternalExtractorEdge
return v;
}
};
}
}

View File

@ -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,

View File

@ -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_,

View File

@ -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();

View File

@ -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";

View File

@ -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);

View File

@ -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);
}

View File

@ -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) \

View File

@ -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();

View File

@ -261,9 +261,8 @@ parse_segment_lookup_from_csv_files(const std::vector<std::string> &segment_spee
if (!ok || it != last)
throw util::exception{"Segment speed file " + filename + " malformed"};
SegmentSpeedSource val{
{OSMNodeID{from_node_id}, OSMNodeID{to_node_id}},
{speed, static_cast<std::uint8_t>(file_id)}};
SegmentSpeedSource val{{OSMNodeID{from_node_id}, OSMNodeID{to_node_id}},
{speed, static_cast<std::uint8_t>(file_id)}};
local.push_back(std::move(val));
}
@ -382,7 +381,7 @@ EdgeID Contractor::LoadEdgeExpandedGraph(
using boost::interprocess::mapped_region;
using boost::interprocess::read_only;
const file_mapping mapping{ filename.c_str(), read_only };
const file_mapping mapping{filename.c_str(), read_only};
mapped_region region{mapping, read_only};
region.advise(mapped_region::advice_sequential);
return region;
@ -409,19 +408,21 @@ EdgeID Contractor::LoadEdgeExpandedGraph(
return boost::interprocess::mapped_region();
}();
// Set the struct packing to 1 byte word sizes. This prevents any padding. We only use
// this struct once, so any alignment penalty is trivial. If this is *not* done, then
// the struct will be padded out by an extra 4 bytes, and sizeof() will mean we read
// too much data from the original file.
#pragma pack(push, r1, 1)
struct EdgeBasedGraphHeader {
// Set the struct packing to 1 byte word sizes. This prevents any padding. We only use
// this struct once, so any alignment penalty is trivial. If this is *not* done, then
// the struct will be padded out by an extra 4 bytes, and sizeof() will mean we read
// too much data from the original file.
#pragma pack(push, r1, 1)
struct EdgeBasedGraphHeader
{
util::FingerPrint fingerprint;
std::uint64_t number_of_edges;
EdgeID max_edge_id;
};
#pragma pack(pop, r1)
#pragma pack(pop, r1)
const EdgeBasedGraphHeader graph_header = *(reinterpret_cast<const EdgeBasedGraphHeader *>(edge_based_graph_region.get_address()));
const EdgeBasedGraphHeader graph_header =
*(reinterpret_cast<const EdgeBasedGraphHeader *>(edge_based_graph_region.get_address()));
const util::FingerPrint fingerprint_valid = util::FingerPrint::GetValid();
graph_header.fingerprint.TestContractor(fingerprint_valid);
@ -737,14 +738,17 @@ EdgeID Contractor::LoadEdgeExpandedGraph(
tbb::parallel_invoke(maybe_save_geometries, save_datasource_indexes, save_datastore_names);
auto penaltyblock =
reinterpret_cast<const extractor::lookup::PenaltyBlock *>(edge_penalty_region.get_address());
auto penaltyblock = reinterpret_cast<const extractor::lookup::PenaltyBlock *>(
edge_penalty_region.get_address());
auto edge_segment_byte_ptr = reinterpret_cast<const char *>(edge_segment_region.get_address());
auto edge_based_edge_ptr = reinterpret_cast<extractor::EdgeBasedEdge *>(
reinterpret_cast<char *>(edge_based_graph_region.get_address()) + sizeof(EdgeBasedGraphHeader));
reinterpret_cast<char *>(edge_based_graph_region.get_address()) +
sizeof(EdgeBasedGraphHeader));
const auto edge_based_edge_last = reinterpret_cast<extractor::EdgeBasedEdge *>(
reinterpret_cast<char *>(edge_based_graph_region.get_address()) + sizeof(EdgeBasedGraphHeader) + sizeof(extractor::EdgeBasedEdge) * graph_header.number_of_edges);
reinterpret_cast<char *>(edge_based_graph_region.get_address()) +
sizeof(EdgeBasedGraphHeader) +
sizeof(extractor::EdgeBasedEdge) * graph_header.number_of_edges);
while (edge_based_edge_ptr != edge_based_edge_last)
{
@ -777,7 +781,8 @@ EdgeID Contractor::LoadEdgeExpandedGraph(
{
if (speed_iter->speed_source.speed > 0)
{
auto new_segment_weight = distanceAndSpeedToWeight(segmentblocks[i].segment_length, speed_iter->speed_source.speed);
auto new_segment_weight = distanceAndSpeedToWeight(
segmentblocks[i].segment_length, speed_iter->speed_source.speed);
new_weight += new_segment_weight;
}
else

View File

@ -83,7 +83,8 @@ util::json::Array lanesFromIntersection(const guidance::Intersection &intersecti
util::json::Object lane;
lane.values["indications"] = extractor::guidance::TurnLaneType::toJsonArray(lane_desc);
if (lane_id >= intersection.lanes.first_lane_from_the_right &&
lane_id < intersection.lanes.first_lane_from_the_right + intersection.lanes.lanes_in_turn)
lane_id <
intersection.lanes.first_lane_from_the_right + intersection.lanes.lanes_in_turn)
lane.values["valid"] = util::json::True();
else
lane.values["valid"] = util::json::False();

View File

@ -1,5 +1,5 @@
#include "extractor/guidance/turn_instruction.hpp"
#include "engine/guidance/post_processing.hpp"
#include "extractor/guidance/turn_instruction.hpp"
#include "engine/guidance/assemble_steps.hpp"
#include "engine/guidance/lane_processing.hpp"
@ -1161,7 +1161,7 @@ std::vector<RouteStep> collapseUseLane(std::vector<RouteStep> steps)
{
const auto previous = getPreviousIndex(step_index);
steps[previous] = elongate(steps[previous], steps[step_index]);
//elongate(steps[step_index-1], steps[step_index]);
// elongate(steps[step_index-1], steps[step_index]);
invalidateStep(steps[step_index]);
}
}

View File

@ -116,8 +116,10 @@ std::vector<util::Coordinate> decodePolyline(const std::string &geometry_string)
lng += dlng;
util::Coordinate p;
p.lat = util::FixedLatitude{static_cast<std::int32_t>(lat * detail::POLYLINE_TO_COORDINATE)};
p.lon = util::FixedLongitude{static_cast<std::int32_t>(lng * detail::POLYLINE_TO_COORDINATE)};
p.lat =
util::FixedLatitude{static_cast<std::int32_t>(lat * detail::POLYLINE_TO_COORDINATE)};
p.lon =
util::FixedLongitude{static_cast<std::int32_t>(lng * detail::POLYLINE_TO_COORDINATE)};
new_coordinates.push_back(p);
}

View File

@ -1,5 +1,5 @@
#include "extractor/edge_based_edge.hpp"
#include "extractor/edge_based_graph_factory.hpp"
#include "extractor/edge_based_edge.hpp"
#include "util/coordinate.hpp"
#include "util/coordinate_calculation.hpp"
#include "util/exception.hpp"
@ -422,7 +422,8 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges(
distance += profile_properties.traffic_signal_penalty;
}
const int32_t turn_penalty = scripting_environment.GetTurnPenalty(180. - turn.angle);
const int32_t turn_penalty =
scripting_environment.GetTurnPenalty(180. - turn.angle);
const auto turn_instruction = turn.instruction;
if (turn_instruction.direction_modifier == guidance::DirectionModifier::UTurn)

View File

@ -83,7 +83,8 @@ int Extractor::run(ScriptingEnvironment &scripting_environment)
tbb::task_scheduler_init init(number_of_threads);
util::SimpleLogger().Write() << "Input file: " << config.input_path.filename().string();
if (!config.profile_path.empty()) {
if (!config.profile_path.empty())
{
util::SimpleLogger().Write() << "Profile: " << config.profile_path.filename().string();
}
util::SimpleLogger().Write() << "Threads: " << number_of_threads;
@ -151,7 +152,6 @@ int Extractor::run(ScriptingEnvironment &scripting_environment)
resulting_ways,
resulting_restrictions);
number_of_nodes += resulting_nodes.size();
// put parsed objects thru extractor callbacks
for (const auto &result : resulting_nodes)

View File

@ -1,8 +1,8 @@
#include "extractor/extractor_callbacks.hpp"
#include "extractor/external_memory_node.hpp"
#include "extractor/extraction_containers.hpp"
#include "extractor/extraction_node.hpp"
#include "extractor/extraction_way.hpp"
#include "extractor/extractor_callbacks.hpp"
#include "extractor/guidance/road_classification.hpp"
#include "extractor/restriction.hpp"

View File

@ -160,7 +160,8 @@ void GraphCompressor::Compress(const std::unordered_set<NodeID> &barrier_nodes,
* turn-lanes. Without this,we would have to treat any turn-lane beginning/ending just
* like a barrier.
*/
const auto selectLaneID = [](const LaneDescriptionID front, const LaneDescriptionID back) {
const auto selectLaneID = [](const LaneDescriptionID front,
const LaneDescriptionID back) {
// 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
@ -168,10 +169,12 @@ void GraphCompressor::Compress(const std::unordered_set<NodeID> &barrier_nodes,
return front;
return back;
};
graph.GetEdgeData(forward_e1).lane_description_id = selectLaneID(
graph.GetEdgeData(forward_e1).lane_description_id, fwd_edge_data2.lane_description_id);
graph.GetEdgeData(reverse_e1).lane_description_id = selectLaneID(
graph.GetEdgeData(reverse_e1).lane_description_id, rev_edge_data2.lane_description_id);
graph.GetEdgeData(forward_e1).lane_description_id =
selectLaneID(graph.GetEdgeData(forward_e1).lane_description_id,
fwd_edge_data2.lane_description_id);
graph.GetEdgeData(reverse_e1).lane_description_id =
selectLaneID(graph.GetEdgeData(reverse_e1).lane_description_id,
rev_edge_data2.lane_description_id);
// remove e2's (if bidir, otherwise only one)
graph.DeleteEdge(node_v, forward_e2);

View File

@ -1,5 +1,5 @@
#include "extractor/guidance/constants.hpp"
#include "extractor/guidance/intersection_handler.hpp"
#include "extractor/guidance/constants.hpp"
#include "extractor/guidance/toolkit.hpp"
#include "util/guidance/toolkit.hpp"

View File

@ -1,5 +1,5 @@
#include "extractor/guidance/constants.hpp"
#include "extractor/guidance/motorway_handler.hpp"
#include "extractor/guidance/constants.hpp"
#include "extractor/guidance/road_classification.hpp"
#include "extractor/guidance/toolkit.hpp"

View File

@ -1,6 +1,6 @@
#include "extractor/guidance/sliproad_handler.hpp"
#include "extractor/guidance/constants.hpp"
#include "extractor/guidance/intersection_scenario_three_way.hpp"
#include "extractor/guidance/sliproad_handler.hpp"
#include "extractor/guidance/toolkit.hpp"
#include "util/guidance/toolkit.hpp"
@ -74,8 +74,7 @@ operator()(const NodeID, const EdgeID source_edge_id, Intersection intersection)
const auto check_valid = [this, source_edge_data](const ConnectedRoad &road) {
const auto road_edge_data = node_based_graph.GetEdgeData(road.turn.eid);
// Test to see if the source edge and the one we're looking at are the same road
return road_edge_data.road_classification ==
source_edge_data.road_classification &&
return road_edge_data.road_classification == source_edge_data.road_classification &&
road_edge_data.name_id != EMPTY_NAMEID &&
road_edge_data.name_id == source_edge_data.name_id && road.entry_allowed;
};
@ -143,8 +142,8 @@ operator()(const NodeID, const EdgeID source_edge_id, Intersection intersection)
}
else
{
const auto skip_traffic_light_intersection =
intersection_generator(node_based_graph.GetTarget(candidate_in), candidate_road.turn.eid);
const auto skip_traffic_light_intersection = intersection_generator(
node_based_graph.GetTarget(candidate_in), candidate_road.turn.eid);
if (skip_traffic_light_intersection.size() == 2 &&
node_based_graph.GetTarget(
skip_traffic_light_intersection[1].turn.eid) ==

View File

@ -1,6 +1,6 @@
#include "extractor/guidance/road_classification.hpp"
#include "extractor/guidance/constants.hpp"
#include "extractor/guidance/turn_analysis.hpp"
#include "extractor/guidance/constants.hpp"
#include "extractor/guidance/road_classification.hpp"
#include "util/coordinate.hpp"
#include "util/coordinate_calculation.hpp"
@ -86,8 +86,7 @@ Intersection TurnAnalysis::assignTurnTypes(const NodeID from_nid,
intersection = sliproad_handler(from_nid, via_eid, std::move(intersection));
// Turn On Ramps Into Off Ramps, if we come from a motorway-like road
if (node_based_graph.GetEdgeData(via_eid)
.road_classification.IsMotorwayClass())
if (node_based_graph.GetEdgeData(via_eid).road_classification.IsMotorwayClass())
{
std::for_each(intersection.begin(), intersection.end(), [](ConnectedRoad &road) {
if (road.turn.instruction.type == TurnType::OnRamp)

View File

@ -1,7 +1,7 @@
#include "extractor/guidance/turn_handler.hpp"
#include "extractor/guidance/constants.hpp"
#include "extractor/guidance/intersection_scenario_three_way.hpp"
#include "extractor/guidance/toolkit.hpp"
#include "extractor/guidance/turn_handler.hpp"
#include "util/guidance/toolkit.hpp"

View File

@ -268,7 +268,8 @@ LaneDataVector handleNoneValueAtSimpleTurn(LaneDataVector lane_data,
((intersection[0].entry_allowed && lane_data.back().tag != TurnLaneType::uturn) ? 1 : 0);
// TODO check for impossible turns to see whether the turn lane is at the correct place
const std::size_t none_index = std::distance(lane_data.begin(), findTag(TurnLaneType::none, lane_data));
const std::size_t none_index =
std::distance(lane_data.begin(), findTag(TurnLaneType::none, lane_data));
BOOST_ASSERT(none_index != lane_data.size());
// we have to create multiple turns
if (connection_count > lane_data.size())

View File

@ -1,7 +1,7 @@
#include "extractor/guidance/turn_lane_handler.hpp"
#include "extractor/guidance/constants.hpp"
#include "extractor/guidance/turn_discovery.hpp"
#include "extractor/guidance/turn_lane_augmentation.hpp"
#include "extractor/guidance/turn_lane_handler.hpp"
#include "extractor/guidance/turn_lane_matcher.hpp"
#include "util/simple_logger.hpp"
#include "util/typedefs.hpp"
@ -63,8 +63,8 @@ Intersection TurnLaneHandler::assignTurnLanes(const NodeID at,
Intersection intersection,
LaneDataIdMap &id_map) const
{
//if only a uturn exists, there is nothing we can do
if( intersection.size() == 1 )
// if only a uturn exists, there is nothing we can do
if (intersection.size() == 1)
return intersection;
const auto &data = node_based_graph.GetEdgeData(via_edge);
@ -77,7 +77,9 @@ Intersection TurnLaneHandler::assignTurnLanes(const NodeID at,
turn_lane_masks.begin() + turn_lane_offsets[data.lane_description_id + 1])
: TurnLaneDescription();
BOOST_ASSERT( turn_lane_description.empty() || turn_lane_description.size() == (turn_lane_offsets[data.lane_description_id+1] - turn_lane_offsets[data.lane_description_id]));
BOOST_ASSERT(turn_lane_description.empty() ||
turn_lane_description.size() == (turn_lane_offsets[data.lane_description_id + 1] -
turn_lane_offsets[data.lane_description_id]));
// going straight, due to traffic signals, we can have uncompressed geometry
if (intersection.size() == 2 &&

View File

@ -1,5 +1,5 @@
#include "extractor/guidance/toolkit.hpp"
#include "extractor/guidance/turn_lane_matcher.hpp"
#include "extractor/guidance/toolkit.hpp"
#include "util/guidance/toolkit.hpp"
#include <boost/assert.hpp>

View File

@ -154,8 +154,9 @@ SourceContainer::GetRasterInterpolateFromSource(unsigned int source_id, double l
BOOST_ASSERT(lon > -180);
const auto &found = LoadedSources[source_id];
return found.GetRasterInterpolate(static_cast<std::int32_t>(util::toFixed(util::FloatLongitude{lon})),
static_cast<std::int32_t>(util::toFixed(util::FloatLatitude{lat})));
return found.GetRasterInterpolate(
static_cast<std::int32_t>(util::toFixed(util::FloatLongitude{lon})),
static_cast<std::int32_t>(util::toFixed(util::FloatLatitude{lat})));
}
}
}

View File

@ -1,3 +1,4 @@
#include "storage/storage.hpp"
#include "contractor/query_edge.hpp"
#include "extractor/compressed_edge_container.hpp"
#include "extractor/guidance/turn_instruction.hpp"
@ -8,7 +9,6 @@
#include "storage/shared_barriers.hpp"
#include "storage/shared_datatype.hpp"
#include "storage/shared_memory.hpp"
#include "storage/storage.hpp"
#include "engine/datafacade/datafacade_base.hpp"
#include "util/coordinate.hpp"
#include "util/exception.hpp"
@ -375,7 +375,7 @@ int Storage::Run()
}
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));
std::vector<DiscreteBearing> bearing_class_table(num_bearings);
intersection_stream.read(reinterpret_cast<char *>(&bearing_class_table[0]),

View File

@ -85,7 +85,7 @@ return_code parseArguments(int argc, char *argv[], contractor::ContractorConfig
.run(),
option_variables);
}
catch(boost::program_options::error& e)
catch (boost::program_options::error &e)
{
util::SimpleLogger().Write(logWARNING) << "[error] " << e.what();
return return_code::fail;

View File

@ -130,7 +130,7 @@ inline unsigned generateServerProgramOptions(const int argc,
.run(),
option_variables);
}
catch(boost::program_options::error& e)
catch (boost::program_options::error &e)
{
util::SimpleLogger().Write(logWARNING) << "[error] " << e.what();
return INIT_FAILED;

View File

@ -284,8 +284,10 @@ Coordinate interpolateLinear(double factor, const Coordinate from, const Coordin
const auto to_lon = static_cast<std::int32_t>(to.lon);
const auto to_lat = static_cast<std::int32_t>(to.lat);
FixedLongitude interpolated_lon{static_cast<std::int32_t>(from_lon + factor * (to_lon - from_lon))};
FixedLatitude interpolated_lat{static_cast<std::int32_t>(from_lat + factor * (to_lat - from_lat))};
FixedLongitude interpolated_lon{
static_cast<std::int32_t>(from_lon + factor * (to_lon - from_lon))};
FixedLatitude interpolated_lat{
static_cast<std::int32_t>(from_lat + factor * (to_lat - from_lat))};
return {std::move(interpolated_lon), std::move(interpolated_lat)};
}

View File

@ -19,7 +19,7 @@ BOOST_AUTO_TEST_CASE(insert_and_retrieve_packed_test)
for (std::size_t i = 0; i < num_test_cases; i++)
{
OSMNodeID r {static_cast<std::uint64_t>(rand() % 2147483647)}; // max 33-bit uint
OSMNodeID r{static_cast<std::uint64_t>(rand() % 2147483647)}; // max 33-bit uint
packed_ids.push_back(r);
original_ids.push_back(r);