DataStructures/RawRouteData.h -> DataStructures/internal_route_result.hpp, implements #1238
This commit is contained in:
parent
8bd7d57dd8
commit
1b10f53eff
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (c) 2014, Project OSRM, Dennis Luxen, others
|
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
@ -25,12 +25,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef RAW_ROUTE_DATA_HPP
|
#ifndef RAW_ROUTE_DATA_H
|
||||||
#define RAW_ROUTE_DATA_HPP
|
#define RAW_ROUTE_DATA_H
|
||||||
|
|
||||||
#include "../data_structures/phantom_node.hpp"
|
#include "../DataStructures/phantom_node.hpp"
|
||||||
#include "../data_structures/travel_mode.hpp"
|
#include "../DataStructures/TravelMode.h"
|
||||||
#include "../data_structures/turn_instructions.hpp"
|
#include "../DataStructures/TurnInstructions.h"
|
||||||
#include "../typedefs.h"
|
#include "../typedefs.h"
|
||||||
|
|
||||||
#include <osrm/coordinate.hpp>
|
#include <osrm/coordinate.hpp>
|
||||||
@ -63,7 +63,7 @@ struct PathData
|
|||||||
TravelMode travel_mode : 4;
|
TravelMode travel_mode : 4;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RawRouteData
|
struct InternalRouteResult
|
||||||
{
|
{
|
||||||
std::vector<std::vector<PathData>> unpacked_path_segments;
|
std::vector<std::vector<PathData>> unpacked_path_segments;
|
||||||
std::vector<PathData> unpacked_alternative;
|
std::vector<PathData> unpacked_alternative;
|
||||||
@ -80,11 +80,11 @@ struct RawRouteData
|
|||||||
return (leg != unpacked_path_segments.size() - 1);
|
return (leg != unpacked_path_segments.size() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
RawRouteData() :
|
InternalRouteResult() :
|
||||||
shortest_path_length(INVALID_EDGE_WEIGHT),
|
shortest_path_length(INVALID_EDGE_WEIGHT),
|
||||||
alternative_path_length(INVALID_EDGE_WEIGHT)
|
alternative_path_length(INVALID_EDGE_WEIGHT)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // RAW_ROUTE_DATA_HPP
|
#endif // RAW_ROUTE_DATA_H
|
@ -79,7 +79,7 @@ template <class DataFacadeT> class BaseDescriptor
|
|||||||
BaseDescriptor() {}
|
BaseDescriptor() {}
|
||||||
// Maybe someone can explain the pure virtual destructor thing to me (dennis)
|
// Maybe someone can explain the pure virtual destructor thing to me (dennis)
|
||||||
virtual ~BaseDescriptor() {}
|
virtual ~BaseDescriptor() {}
|
||||||
virtual void Run(const RawRouteData &, JSON::Object &) = 0;
|
virtual void Run(const InternalRouteResult &, JSON::Object &) = 0;
|
||||||
virtual void SetConfig(const DescriptorConfig &) = 0;
|
virtual void SetConfig(const DescriptorConfig &) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ template <class DataFacadeT> class GPXDescriptor final : public BaseDescriptor<D
|
|||||||
|
|
||||||
void SetConfig(const DescriptorConfig &c) final { config = c; }
|
void SetConfig(const DescriptorConfig &c) final { config = c; }
|
||||||
|
|
||||||
void Run(const RawRouteData &raw_route, JSON::Object &json_result) final
|
void Run(const InternalRouteResult &raw_route, JSON::Object &json_result) final
|
||||||
{
|
{
|
||||||
JSON::Array json_route;
|
JSON::Array json_route;
|
||||||
if (raw_route.shortest_path_length != INVALID_EDGE_WEIGHT)
|
if (raw_route.shortest_path_length != INVALID_EDGE_WEIGHT)
|
||||||
|
@ -99,7 +99,7 @@ template <class DataFacadeT> class JSONDescriptor final : public BaseDescriptor<
|
|||||||
return added_element_count;
|
return added_element_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Run(const RawRouteData &raw_route, JSON::Object &json_result) final
|
void Run(const InternalRouteResult &raw_route, JSON::Object &json_result) final
|
||||||
{
|
{
|
||||||
if (INVALID_EDGE_WEIGHT == raw_route.shortest_path_length)
|
if (INVALID_EDGE_WEIGHT == raw_route.shortest_path_length)
|
||||||
{
|
{
|
||||||
|
@ -143,7 +143,7 @@ template <class DataFacadeT> class ViaRoutePlugin final : public BasePlugin
|
|||||||
swap_phantom_from_big_cc_into_front);
|
swap_phantom_from_big_cc_into_front);
|
||||||
}
|
}
|
||||||
|
|
||||||
RawRouteData raw_route;
|
InternalRouteResult raw_route;
|
||||||
auto build_phantom_pairs =
|
auto build_phantom_pairs =
|
||||||
[&raw_route](const phantom_node_pair &first_pair, const phantom_node_pair &second_pair)
|
[&raw_route](const phantom_node_pair &first_pair, const phantom_node_pair &second_pair)
|
||||||
{
|
{
|
||||||
|
@ -78,7 +78,7 @@ template <class DataFacadeT> class AlternativeRouting final : private BasicRouti
|
|||||||
|
|
||||||
virtual ~AlternativeRouting() {}
|
virtual ~AlternativeRouting() {}
|
||||||
|
|
||||||
void operator()(const PhantomNodes &phantom_node_pair, RawRouteData &raw_route_data)
|
void operator()(const PhantomNodes &phantom_node_pair, InternalRouteResult &raw_route_data)
|
||||||
{
|
{
|
||||||
std::vector<NodeID> alternative_path;
|
std::vector<NodeID> alternative_path;
|
||||||
std::vector<NodeID> via_node_candidate_list;
|
std::vector<NodeID> via_node_candidate_list;
|
||||||
|
@ -51,7 +51,7 @@ template <class DataFacadeT> class ShortestPathRouting final : public BasicRouti
|
|||||||
|
|
||||||
void operator()(const std::vector<PhantomNodes> &phantom_nodes_vector,
|
void operator()(const std::vector<PhantomNodes> &phantom_nodes_vector,
|
||||||
const std::vector<bool> &uturn_indicators,
|
const std::vector<bool> &uturn_indicators,
|
||||||
RawRouteData &raw_route_data) const
|
InternalRouteResult &raw_route_data) const
|
||||||
{
|
{
|
||||||
int distance1 = 0;
|
int distance1 = 0;
|
||||||
int distance2 = 0;
|
int distance2 = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user