osrm-backend/include/extractor/extraction_way.hpp

68 lines
1.8 KiB
C++
Raw Normal View History

#ifndef EXTRACTION_WAY_HPP
#define EXTRACTION_WAY_HPP
2016-01-02 11:13:44 -05:00
#include "extractor/travel_mode.hpp"
2016-05-13 13:18:00 -04:00
#include "util/guidance/turn_lanes.hpp"
2016-06-15 08:38:24 -04:00
#include "util/typedefs.hpp"
#include <string>
#include <vector>
2016-01-05 10:51:13 -05:00
namespace osrm
{
namespace extractor
{
2015-04-08 12:53:10 -04:00
/**
* This struct is the direct result of the call to ```way_function```
* in the lua based profile.
*
* It is split into multiple edge segments in the ExtractorCallback.
*/
2014-05-09 10:17:31 -04:00
struct ExtractionWay
{
2014-11-19 04:53:28 -05:00
ExtractionWay() { clear(); }
2014-11-19 04:53:28 -05:00
void clear()
2014-05-09 10:17:31 -04:00
{
2014-08-18 09:38:07 -04:00
forward_speed = -1;
backward_speed = -1;
duration = -1;
roundabout = false;
is_startpoint = true;
2014-08-26 11:02:05 -04:00
is_access_restricted = false;
name.clear();
pronunciation.clear();
2016-05-26 18:47:46 -04:00
destinations.clear();
forward_travel_mode = TRAVEL_MODE_INACCESSIBLE;
backward_travel_mode = TRAVEL_MODE_INACCESSIBLE;
2016-05-13 13:18:00 -04:00
turn_lanes_forward.clear();
turn_lanes_backward.clear();
}
2014-08-20 05:37:47 -04:00
// These accessors exists because it's not possible to take the address of a bitfield,
// and LUA therefore cannot read/write the mode attributes directly.
void set_forward_mode(const TravelMode m) { forward_travel_mode = m; }
TravelMode get_forward_mode() const { return forward_travel_mode; }
void set_backward_mode(const TravelMode m) { backward_travel_mode = m; }
TravelMode get_backward_mode() const { return backward_travel_mode; }
2014-08-11 08:07:00 -04:00
2014-08-18 09:38:07 -04:00
double forward_speed;
double backward_speed;
double duration;
std::string name;
std::string pronunciation;
2016-05-26 18:47:46 -04:00
std::string destinations;
2016-05-13 13:18:00 -04:00
std::string turn_lanes_forward;
std::string turn_lanes_backward;
bool roundabout;
2014-08-26 11:02:05 -04:00
bool is_access_restricted;
bool is_startpoint;
2014-08-18 09:38:07 -04:00
TravelMode forward_travel_mode : 4;
2014-08-11 08:07:00 -04:00
TravelMode backward_travel_mode : 4;
};
2016-01-05 10:51:13 -05:00
}
}
#endif // EXTRACTION_WAY_HPP