osrm-backend/unit_tests/mocks/mock_scripting_environment.hpp
Michael Bell 5266ac1635
Add support for multiple via-way restrictions (#5907)
Currently OSRM only supports turn restrictions with a single via-node or one
via-way. OSM allows for multiple via-ways to represent longer and more
complex restrictions.

This PR extends the use of duplicate nodes for representng via-way turn
restrictions to also support multi via-way restrictions. Effectively, this
increases the edge-based graph size by the number of edges in multi via-way
restrictions. However, given the low number of these restrictions it
has little effect on total graph size.

In addition, we add a new step in the extraction phase that constructs
a restriction graph to support more complex relationships between restrictions,
such as nested restrictions and overlapping restrictions.
2020-12-20 13:59:57 -08:00

57 lines
2.0 KiB
C++

#ifndef MOCK_SCRIPTING_ENVIRONMENT_HPP_
#define MOCK_SCRIPTING_ENVIRONMENT_HPP_
#include "extractor/extraction_segment.hpp"
#include "extractor/extraction_turn.hpp"
#include "extractor/maneuver_override.hpp"
#include "extractor/profile_properties.hpp"
#include "extractor/scripting_environment.hpp"
#include <string>
#include <utility>
#include <vector>
namespace osrm
{
namespace test
{
// a mock implementation of the scripting environment doing exactly nothing
class MockScriptingEnvironment : public extractor::ScriptingEnvironment
{
const extractor::ProfileProperties &GetProfileProperties() override final
{
static extractor::ProfileProperties properties;
return properties;
}
std::vector<std::string> GetNameSuffixList() override final { return {}; }
std::vector<std::vector<std::string>> GetExcludableClasses() override final { return {}; };
std::vector<std::string> GetClassNames() override { return {}; };
std::vector<std::string> GetRelations() override { return {}; };
std::vector<std::string> GetRestrictions() override final { return {}; }
void ProcessTurn(extractor::ExtractionTurn &) override final {}
void ProcessSegment(extractor::ExtractionSegment &) override final {}
void ProcessElements(const osmium::memory::Buffer &,
const extractor::RestrictionParser &,
const extractor::ManeuverOverrideRelationParser &,
const extractor::ExtractionRelationContainer &,
std::vector<std::pair<const osmium::Node &, extractor::ExtractionNode>> &,
std::vector<std::pair<const osmium::Way &, extractor::ExtractionWay>> &,
std::vector<extractor::InputTurnRestriction> &,
std::vector<extractor::InputManeuverOverride> &) override final
{
}
bool HasLocationDependentData() const override { return false; };
};
} // namespace test
} // namespace osrm
#endif // MOCK_SCRIPTING_ENVIRONMENT_HPP_