clang format

This commit is contained in:
karenzshea 2017-02-03 17:24:34 +01:00 committed by Patrick Niklaus
parent c885d03830
commit 1e9e420d91
3 changed files with 9 additions and 8 deletions

View File

@ -120,8 +120,9 @@ struct RouteParameters : public BaseParameters
const boost::optional<bool> continue_straight_, const boost::optional<bool> continue_straight_,
Args... args_) Args... args_)
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_}, : BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
annotations_type{annotations_}, annotations{annotations_ == AnnotationsType::None ? false : true}, geometries{geometries_}, annotations_type{annotations_},
overview{overview_}, continue_straight{continue_straight_} annotations{annotations_ == AnnotationsType::None ? false : true},
geometries{geometries_}, overview{overview_}, continue_straight{continue_straight_}
{ {
} }
@ -136,8 +137,7 @@ struct RouteParameters : public BaseParameters
bool IsValid() const { return coordinates.size() >= 2 && BaseParameters::IsValid(); } bool IsValid() const { return coordinates.size() >= 2 && BaseParameters::IsValid(); }
}; };
inline bool operator&(RouteParameters::AnnotationsType lhs, inline bool operator&(RouteParameters::AnnotationsType lhs, RouteParameters::AnnotationsType rhs)
RouteParameters::AnnotationsType rhs)
{ {
return static_cast<bool>( return static_cast<bool>(
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(lhs) & static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(lhs) &
@ -157,7 +157,6 @@ inline RouteParameters::AnnotationsType operator|=(RouteParameters::AnnotationsT
{ {
return lhs = lhs | rhs; return lhs = lhs | rhs;
} }
} }
} }
} }

View File

@ -45,7 +45,8 @@ struct RouteParametersGrammar : public BaseParametersGrammar<Iterator, Signature
const auto add_annotation = [](engine::api::RouteParameters &route_parameters, const auto add_annotation = [](engine::api::RouteParameters &route_parameters,
engine::api::RouteParameters::AnnotationsType &route_param) { engine::api::RouteParameters::AnnotationsType &route_param) {
route_parameters.annotations_type = route_parameters.annotations_type | route_param; route_parameters.annotations_type = route_parameters.annotations_type | route_param;
route_parameters.annotations = route_parameters.annotations_type != engine::api::RouteParameters::AnnotationsType::None; route_parameters.annotations = route_parameters.annotations_type !=
engine::api::RouteParameters::AnnotationsType::None;
}; };
geometries_type.add("geojson", engine::api::RouteParameters::GeometriesType::GeoJSON)( geometries_type.add("geojson", engine::api::RouteParameters::GeometriesType::GeoJSON)(

View File

@ -345,7 +345,8 @@ BOOST_AUTO_TEST_CASE(valid_route_urls)
"overview=simplified&annotations=duration"); "overview=simplified&annotations=duration");
BOOST_CHECK(result_15); BOOST_CHECK(result_15);
BOOST_CHECK_EQUAL(reference_15.geometries, result_15->geometries); BOOST_CHECK_EQUAL(reference_15.geometries, result_15->geometries);
BOOST_CHECK_EQUAL(result_15->annotations_type == RouteParameters::AnnotationsType::Duration, true); BOOST_CHECK_EQUAL(result_15->annotations_type == RouteParameters::AnnotationsType::Duration,
true);
BOOST_CHECK_EQUAL(result_15->annotations, true); BOOST_CHECK_EQUAL(result_15->annotations, true);
// parse multiple annotations correctly // parse multiple annotations correctly