[skip ci] Fix formating using format.sh

This commit is contained in:
Patrick Niklaus 2016-10-28 14:45:05 -07:00
parent 9435254661
commit f02b7b0910
No known key found for this signature in database
GPG Key ID: E426891B5F978B1B
12 changed files with 45 additions and 41 deletions

View File

@ -74,8 +74,7 @@ util::json::Object makeGeoJSONGeometry(ForwardIter begin, ForwardIter end)
util::json::Object makeStepManeuver(const guidance::StepManeuver &maneuver);
util::json::Object makeRouteStep(guidance::RouteStep step,
util::json::Value geometry);
util::json::Object makeRouteStep(guidance::RouteStep step, util::json::Value geometry);
util::json::Object makeRoute(const guidance::Route &route,
util::json::Array legs,

View File

@ -17,8 +17,8 @@
#include "util/guidance/turn_lanes.hpp"
#include "engine/geospatial_query.hpp"
#include "util/packed_vector.hpp"
#include "util/guidance/turn_bearing.hpp"
#include "util/packed_vector.hpp"
#include "util/range_table.hpp"
#include "util/rectangle.hpp"
#include "util/simple_logger.hpp"

View File

@ -31,7 +31,8 @@ class ViaRoutePlugin final : public BasePlugin
mutable SearchEngineData heaps;
mutable routing_algorithms::ShortestPathRouting<datafacade::BaseDataFacade> shortest_path;
mutable routing_algorithms::AlternativeRouting<datafacade::BaseDataFacade> alternative_path;
mutable routing_algorithms::DirectShortestPathRouting<datafacade::BaseDataFacade> direct_shortest_path;
mutable routing_algorithms::DirectShortestPathRouting<datafacade::BaseDataFacade>
direct_shortest_path;
const int max_locations_viaroute;
public:

View File

@ -843,8 +843,7 @@ class AlternativeRouting final
const NodeID via_path_middle_node_id = current_edge_data.id;
const EdgeID second_segment_edge_id =
facade.FindEdgeInEitherDirection(via_path_middle_node_id, via_path_edge.second);
const int second_segment_length =
facade.GetEdgeData(second_segment_edge_id).weight;
const int second_segment_length = facade.GetEdgeData(second_segment_edge_id).weight;
// attention: !unpacking in reverse!
// Check if second segment is the one to go over treshold? if yes add second segment
// to stack, else push first segment to stack and add weight of second one.

View File

@ -81,10 +81,10 @@ inline HSGRHeader readHSGRHeader(boost::filesystem::ifstream &input_stream)
using NodeT = typename util::StaticGraph<contractor::QueryEdge::EdgeData>::NodeArrayEntry;
using EdgeT = typename util::StaticGraph<contractor::QueryEdge::EdgeData>::EdgeArrayEntry;
inline void readHSGR(boost::filesystem::ifstream &input_stream,
NodeT *node_buffer,
const std::uint64_t number_of_nodes,
EdgeT *edge_buffer,
const std::uint64_t number_of_edges)
NodeT *node_buffer,
const std::uint64_t number_of_nodes,
EdgeT *edge_buffer,
const std::uint64_t number_of_edges)
{
BOOST_ASSERT(node_buffer);
BOOST_ASSERT(edge_buffer);
@ -177,7 +177,6 @@ void readNodes(boost::filesystem::ifstream &nodes_input_stream,
}
}
// Reads datasource names out of .datasource_names files and metadata such as
// the length and offset of each name
struct DatasourceNamesData
@ -186,7 +185,8 @@ struct DatasourceNamesData
std::vector<std::size_t> offsets;
std::vector<std::size_t> lengths;
};
inline DatasourceNamesData readDatasourceNames(boost::filesystem::ifstream &datasource_names_input_stream)
inline DatasourceNamesData
readDatasourceNames(boost::filesystem::ifstream &datasource_names_input_stream)
{
DatasourceNamesData datasource_names_data;
std::string name;
@ -215,7 +215,6 @@ void readRamIndex(boost::filesystem::ifstream &ram_index_input_stream,
ram_index_input_stream.read(reinterpret_cast<char *>(rtree_buffer),
sizeof(RTreeNodeT) * tree_size);
}
}
}
}

View File

@ -23,14 +23,8 @@ struct SharedBarriers
{
boost::interprocess::named_sharable_mutex::remove("current_regions");
}
static void resetRegions1()
{
boost::interprocess::named_sharable_mutex::remove("regions_1");
}
static void resetRegions2()
{
boost::interprocess::named_sharable_mutex::remove("regions_2");
}
static void resetRegions1() { boost::interprocess::named_sharable_mutex::remove("regions_1"); }
static void resetRegions2() { boost::interprocess::named_sharable_mutex::remove("regions_2"); }
boost::interprocess::named_upgradable_mutex current_regions_mutex;
boost::interprocess::named_sharable_mutex regions_1_mutex;

View File

@ -147,7 +147,6 @@ NodeID loadEdgesFromFile(std::istream &input_stream,
return m;
}
}
}

View File

@ -2,9 +2,9 @@
#include "util/group_by.hpp"
#include "util/guidance/toolkit.hpp"
#include "extractor/guidance/toolkit.hpp"
#include "extractor/guidance/turn_instruction.hpp"
#include "engine/guidance/post_processing.hpp"
#include "extractor/guidance/toolkit.hpp"
#include <iterator>
#include <unordered_set>

View File

@ -132,7 +132,8 @@ Status MatchPlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFaca
if (!time_increases_monotonically)
{
return Error("InvalidValue", "Timestamps need to be monotonically increasing.", json_result);
return Error(
"InvalidValue", "Timestamps need to be monotonically increasing.", json_result);
}
// assuming radius is the standard deviation of a normal distribution

View File

@ -606,7 +606,8 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad
for (const auto &edge : edges)
{
const auto forward_datasource_vector = facade->GetUncompressedForwardDatasources(edge.packed_geometry_id);
const auto forward_datasource_vector =
facade->GetUncompressedForwardDatasources(edge.packed_geometry_id);
const auto reverse_datasource_vector =
facade->GetUncompressedReverseDatasources(edge.packed_geometry_id);
@ -614,8 +615,7 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad
const auto forward_datasource = forward_datasource_vector[edge.fwd_segment_position];
BOOST_ASSERT(edge.fwd_segment_position < reverse_datasource_vector.size());
const auto reverse_datasource = reverse_datasource_vector[reverse_datasource_vector.size() -
edge.fwd_segment_position - 1];
edge.fwd_segment_position - 1];
// Keep track of the highest datasource seen so that we don't write unnecessary
// data to the layer attribute values
@ -655,16 +655,26 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad
const auto a = facade->GetCoordinateOfNode(edge.u);
const auto b = facade->GetCoordinateOfNode(edge.v);
// Calculate the length in meters
const double length = osrm::util::coordinate_calculation::haversineDistance(a, b);
const double length =
osrm::util::coordinate_calculation::haversineDistance(a, b);
const auto forward_weight_vector = facade->GetUncompressedForwardWeights(edge.packed_geometry_id);
const auto reverse_weight_vector = facade->GetUncompressedReverseWeights(edge.packed_geometry_id);
const auto forward_datasource_vector = facade->GetUncompressedForwardDatasources(edge.packed_geometry_id);
const auto reverse_datasource_vector = facade->GetUncompressedReverseDatasources(edge.packed_geometry_id);
const auto forward_weight_vector =
facade->GetUncompressedForwardWeights(edge.packed_geometry_id);
const auto reverse_weight_vector =
facade->GetUncompressedReverseWeights(edge.packed_geometry_id);
const auto forward_datasource_vector =
facade->GetUncompressedForwardDatasources(edge.packed_geometry_id);
const auto reverse_datasource_vector =
facade->GetUncompressedReverseDatasources(edge.packed_geometry_id);
const auto forward_weight = forward_weight_vector[edge.fwd_segment_position];
const auto reverse_weight = reverse_weight_vector[reverse_weight_vector.size() - edge.fwd_segment_position - 1];
const auto forward_datasource = forward_datasource_vector[edge.fwd_segment_position];
const auto reverse_datasource = reverse_datasource_vector[reverse_datasource_vector.size() - edge.fwd_segment_position - 1];
const auto reverse_weight =
reverse_weight_vector[reverse_weight_vector.size() -
edge.fwd_segment_position - 1];
const auto forward_datasource =
forward_datasource_vector[edge.fwd_segment_position];
const auto reverse_datasource =
reverse_datasource_vector[reverse_datasource_vector.size() -
edge.fwd_segment_position - 1];
use_line_value(reverse_weight);
use_line_value(forward_weight);

View File

@ -98,7 +98,7 @@ struct CmpEdgeByInternalSourceTargetAndName
value_type max_value() { return value_type::max_internal_value(); }
value_type min_value() { return value_type::min_internal_value(); }
std::mutex& mutex;
std::mutex &mutex;
const oe::ExtractionContainers::STXXLNameCharData &name_data;
const oe::ExtractionContainers::STXXLNameOffsets &name_offsets;
};

View File

@ -22,9 +22,10 @@ bool generateDataStoreOptions(const int argc,
// declare a group of options that will be allowed both on command line
// as well as in a config file
boost::program_options::options_description config_options("Configuration");
config_options.add_options()("max-wait",
boost::program_options::value<int>(&max_wait)->default_value(-1),
"Maximum number of seconds to wait on requests that use the old dataset.");
config_options.add_options()(
"max-wait",
boost::program_options::value<int>(&max_wait)->default_value(-1),
"Maximum number of seconds to wait on requests that use the old dataset.");
// hidden options, will be allowed on command line but will not be shown to the user
boost::program_options::options_description hidden_options("Hidden options");
@ -110,11 +111,12 @@ int main(const int argc, const char *argv[]) try
const constexpr unsigned MAX_RETRIES = 3;
unsigned retry_counter = 0;
storage::Storage::ReturnCode code = storage::Storage::ReturnCode::Retry;
while(code == storage::Storage::ReturnCode::Retry && retry_counter < MAX_RETRIES)
while (code == storage::Storage::ReturnCode::Retry && retry_counter < MAX_RETRIES)
{
if (retry_counter > 0)
{
util::SimpleLogger().Write(logWARNING) << "Try number " << (retry_counter+1) << " to load the dataset.";
util::SimpleLogger().Write(logWARNING) << "Try number " << (retry_counter + 1)
<< " to load the dataset.";
}
code = storage.Run(max_wait);
retry_counter++;