Takes a stricter aproach for whitelisting / blacklisting restrictions: - uses `restriction=` - uses more specific `restriction:<type>=` - uses `except=<type>` to invert Where `type` is the type of transportation to restrict, e.g. `motorcar`. https://github.com/Project-OSRM/osrm-backend/issues/2833
73 lines
2.1 KiB
C++
73 lines
2.1 KiB
C++
#ifndef SCRIPTING_ENVIRONMENT_HPP
|
|
#define SCRIPTING_ENVIRONMENT_HPP
|
|
|
|
#include "extractor/guidance/turn_lane_types.hpp"
|
|
#include "extractor/internal_extractor_edge.hpp"
|
|
#include "extractor/profile_properties.hpp"
|
|
#include "extractor/restriction.hpp"
|
|
|
|
#include <osmium/memory/buffer.hpp>
|
|
|
|
#include <boost/optional/optional.hpp>
|
|
|
|
#include <tbb/concurrent_vector.h>
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace osmium
|
|
{
|
|
class Node;
|
|
class Way;
|
|
}
|
|
|
|
namespace osrm
|
|
{
|
|
|
|
namespace util
|
|
{
|
|
struct Coordinate;
|
|
}
|
|
|
|
namespace extractor
|
|
{
|
|
|
|
class RestrictionParser;
|
|
struct ExtractionNode;
|
|
struct ExtractionWay;
|
|
|
|
/**
|
|
* Abstract class that handles processing osmium ways, nodes and relation objects by applying
|
|
* user supplied profiles.
|
|
*/
|
|
class ScriptingEnvironment
|
|
{
|
|
public:
|
|
ScriptingEnvironment() = default;
|
|
ScriptingEnvironment(const ScriptingEnvironment &) = delete;
|
|
ScriptingEnvironment &operator=(const ScriptingEnvironment &) = delete;
|
|
virtual ~ScriptingEnvironment() = default;
|
|
|
|
virtual const ProfileProperties &GetProfileProperties() = 0;
|
|
|
|
virtual std::vector<std::string> GetNameSuffixList() = 0;
|
|
virtual std::vector<std::string> GetRestrictions() = 0;
|
|
virtual void SetupSources() = 0;
|
|
virtual int32_t GetTurnPenalty(double angle) = 0;
|
|
virtual void ProcessSegment(const osrm::util::Coordinate &source,
|
|
const osrm::util::Coordinate &target,
|
|
double distance,
|
|
InternalExtractorEdge::WeightData &weight) = 0;
|
|
virtual void
|
|
ProcessElements(const std::vector<osmium::memory::Buffer::const_iterator> &osm_elements,
|
|
const RestrictionParser &restriction_parser,
|
|
tbb::concurrent_vector<std::pair<std::size_t, ExtractionNode>> &resulting_nodes,
|
|
tbb::concurrent_vector<std::pair<std::size_t, ExtractionWay>> &resulting_ways,
|
|
tbb::concurrent_vector<boost::optional<InputRestrictionContainer>>
|
|
&resulting_restrictions) = 0;
|
|
};
|
|
}
|
|
}
|
|
|
|
#endif /* SCRIPTING_ENVIRONMENT_HPP */
|