osrm-backend/include/engine/segment_information.hpp

61 lines
2.2 KiB
C++
Raw Normal View History

#ifndef SEGMENT_INFORMATION_HPP
#define SEGMENT_INFORMATION_HPP
2011-11-24 11:47:05 -05:00
2016-01-02 11:13:44 -05:00
#include "extractor/turn_instructions.hpp"
#include "extractor/travel_mode.hpp"
#include "util/typedefs.hpp"
2016-01-02 11:13:44 -05:00
#include "osrm/coordinate.hpp"
#include <utility>
2016-01-05 10:51:13 -05:00
namespace osrm
{
namespace engine
{
// Struct fits everything in one cache line
2014-05-07 12:39:16 -04:00
struct SegmentInformation
{
2016-01-05 10:51:13 -05:00
util::FixedPointCoordinate location;
NodeID name_id;
2014-06-03 05:28:39 -04:00
EdgeWeight duration;
2014-05-26 09:30:06 -04:00
float length;
short pre_turn_bearing; // more than enough [0..3600] fits into 12 bits
short post_turn_bearing;
2016-01-05 10:51:13 -05:00
extractor::TurnInstruction turn_instruction;
extractor::TravelMode travel_mode;
bool necessary;
bool is_via_location;
2016-01-05 10:51:13 -05:00
explicit SegmentInformation(util::FixedPointCoordinate location,
2014-05-07 12:39:16 -04:00
const NodeID name_id,
2014-06-03 05:28:39 -04:00
const EdgeWeight duration,
2014-05-26 09:30:06 -04:00
const float length,
2016-01-05 10:51:13 -05:00
const extractor::TurnInstruction turn_instruction,
2014-05-26 09:30:06 -04:00
const bool necessary,
const bool is_via_location,
2016-01-05 10:51:13 -05:00
const extractor::TravelMode travel_mode)
: location(std::move(location)), name_id(name_id), duration(duration), length(length),
2016-01-05 06:04:04 -05:00
pre_turn_bearing(0), post_turn_bearing(0), turn_instruction(turn_instruction),
travel_mode(travel_mode), necessary(necessary), is_via_location(is_via_location)
2014-05-07 12:39:16 -04:00
{
}
2016-01-05 10:51:13 -05:00
explicit SegmentInformation(util::FixedPointCoordinate location,
2014-05-07 12:39:16 -04:00
const NodeID name_id,
2014-06-03 05:28:39 -04:00
const EdgeWeight duration,
2014-05-26 09:30:06 -04:00
const float length,
2016-01-05 10:51:13 -05:00
const extractor::TurnInstruction turn_instruction,
const extractor::TravelMode travel_mode)
: location(std::move(location)), name_id(name_id), duration(duration), length(length),
2016-01-05 06:04:04 -05:00
pre_turn_bearing(0), post_turn_bearing(0), turn_instruction(turn_instruction),
2016-01-07 19:31:57 -05:00
travel_mode(travel_mode),
necessary(turn_instruction != extractor::TurnInstruction::NoTurn), is_via_location(false)
2014-05-07 12:39:16 -04:00
{
}
2011-11-24 11:47:05 -05:00
};
2016-01-05 10:51:13 -05:00
}
}
#endif /* SEGMENT_INFORMATION_HPP */