add c'tors to QueryEdge and its EdgeData

This commit is contained in:
Dennis Luxen 2014-07-15 11:46:26 +02:00
parent 8c09edfdbd
commit 495c872489

View File

@ -36,6 +36,16 @@ struct QueryEdge
NodeID target; NodeID target;
struct EdgeData struct EdgeData
{ {
EdgeData() {}
template <class OtherT> EdgeData(const OtherT &other)
{
distance = other.distance;
shortcut = other.shortcut;
id = other.id;
forward = other.forward;
backward = other.backward;
}
NodeID id : 31; NodeID id : 31;
bool shortcut : 1; bool shortcut : 1;
int distance : 30; int distance : 30;
@ -43,6 +53,13 @@ struct QueryEdge
bool backward : 1; bool backward : 1;
} data; } data;
QueryEdge() : source(SPECIAL_NODEID), target(SPECIAL_NODEID) {}
QueryEdge(NodeID source, NodeID target, EdgeData data)
: source(source), target(target), data(data)
{
}
bool operator<(const QueryEdge &right) const bool operator<(const QueryEdge &right) const
{ {
if (source != right.source) if (source != right.source)