further renaming of variable names, reduces legacy lint
This commit is contained in:
@@ -44,72 +44,58 @@ bool NodeBasedEdge::operator<(const NodeBasedEdge &e) const
|
||||
return (source < e.source);
|
||||
}
|
||||
|
||||
NodeBasedEdge::NodeBasedEdge(NodeID s,
|
||||
NodeID t,
|
||||
NodeID n,
|
||||
EdgeWeight w,
|
||||
bool f,
|
||||
bool b,
|
||||
short ty,
|
||||
bool ra,
|
||||
bool ig,
|
||||
bool ar,
|
||||
bool cf,
|
||||
bool is_split)
|
||||
: source(s), target(t), name(n), weight(w), type(ty), forward(f), backward(b),
|
||||
roundabout(ra), ignoreInGrid(ig), accessRestricted(ar), contraFlow(cf),
|
||||
is_split(is_split)
|
||||
{
|
||||
if (ty < 0)
|
||||
{
|
||||
throw OSRMException("negative edge type");
|
||||
}
|
||||
}
|
||||
NodeBasedEdge::NodeBasedEdge(NodeID source,
|
||||
NodeID target,
|
||||
NodeID name_id,
|
||||
EdgeWeight weight,
|
||||
bool forward,
|
||||
bool backward,
|
||||
short type,
|
||||
bool roundabout,
|
||||
bool in_tiny_cc,
|
||||
bool access_restricted,
|
||||
bool contra_flow,
|
||||
bool is_split)
|
||||
: source(source), target(target), name_id(name_id), weight(weight), type(type),
|
||||
forward(forward), backward(backward), roundabout(roundabout), in_tiny_cc(in_tiny_cc),
|
||||
access_restricted(access_restricted), contra_flow(contra_flow), is_split(is_split)
|
||||
{
|
||||
BOOST_ASSERT_MSG(type > 0, "negative edge type");
|
||||
}
|
||||
|
||||
bool EdgeBasedEdge::operator<(const EdgeBasedEdge &e) const
|
||||
bool EdgeBasedEdge::operator<(const EdgeBasedEdge &e) const
|
||||
{
|
||||
if (source == e.source)
|
||||
{
|
||||
if (source() == e.source())
|
||||
if (target == e.target)
|
||||
{
|
||||
if (target() == e.target())
|
||||
if (weight == e.weight)
|
||||
{
|
||||
if (weight() == e.weight())
|
||||
{
|
||||
return (isForward() && isBackward() && ((!e.isForward()) || (!e.isBackward())));
|
||||
}
|
||||
return (weight() < e.weight());
|
||||
return (forward && backward && ((!e.forward) || (!e.backward)));
|
||||
}
|
||||
return (target() < e.target());
|
||||
return (weight < e.weight);
|
||||
}
|
||||
return (source() < e.source());
|
||||
return (target < e.target);
|
||||
}
|
||||
return (source < e.source);
|
||||
}
|
||||
|
||||
template <class EdgeT>
|
||||
EdgeBasedEdge::EdgeBasedEdge(const EdgeT &myEdge)
|
||||
: m_source(myEdge.source), m_target(myEdge.target), m_edgeID(myEdge.data.via),
|
||||
m_weight(myEdge.data.distance), m_forward(myEdge.data.forward),
|
||||
m_backward(myEdge.data.backward)
|
||||
{
|
||||
}
|
||||
template <class EdgeT>
|
||||
EdgeBasedEdge::EdgeBasedEdge(const EdgeT &myEdge)
|
||||
: source(myEdge.source), target(myEdge.target), edge_id(myEdge.data.via),
|
||||
weight(myEdge.data.distance), forward(myEdge.data.forward),
|
||||
backward(myEdge.data.backward)
|
||||
{
|
||||
}
|
||||
|
||||
/** Default constructor. target and weight are set to 0.*/
|
||||
EdgeBasedEdge::EdgeBasedEdge()
|
||||
: m_source(0), m_target(0), m_edgeID(0), m_weight(0), m_forward(false), m_backward(false)
|
||||
{
|
||||
}
|
||||
/** Default constructor. target and weight are set to 0.*/
|
||||
EdgeBasedEdge::EdgeBasedEdge()
|
||||
: source(0), target(0), edge_id(0), weight(0), forward(false), backward(false)
|
||||
{
|
||||
}
|
||||
|
||||
EdgeBasedEdge::EdgeBasedEdge(const NodeID s,
|
||||
const NodeID t,
|
||||
const NodeID v,
|
||||
const EdgeWeight w,
|
||||
const bool f,
|
||||
const bool b)
|
||||
: m_source(s), m_target(t), m_edgeID(v), m_weight(w), m_forward(f), m_backward(b)
|
||||
{
|
||||
}
|
||||
|
||||
NodeID EdgeBasedEdge::target() const { return m_target; }
|
||||
NodeID EdgeBasedEdge::source() const { return m_source; }
|
||||
EdgeWeight EdgeBasedEdge::weight() const { return m_weight; }
|
||||
NodeID EdgeBasedEdge::id() const { return m_edgeID; }
|
||||
bool EdgeBasedEdge::isBackward() const { return m_backward; }
|
||||
bool EdgeBasedEdge::isForward() const { return m_forward; }
|
||||
EdgeBasedEdge::EdgeBasedEdge(
|
||||
const NodeID s, const NodeID t, const NodeID v, const EdgeWeight w, const bool f, const bool b)
|
||||
: source(s), target(t), edge_id(v), weight(w), forward(f), backward(b)
|
||||
{
|
||||
}
|
||||
|
||||
+30
-43
@@ -33,74 +33,61 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
class NodeBasedEdge
|
||||
struct NodeBasedEdge
|
||||
{
|
||||
|
||||
public:
|
||||
bool operator<(const NodeBasedEdge &e) const;
|
||||
|
||||
explicit NodeBasedEdge(NodeID s,
|
||||
NodeID t,
|
||||
NodeID n,
|
||||
EdgeWeight w,
|
||||
bool f,
|
||||
bool b,
|
||||
short ty,
|
||||
bool ra,
|
||||
bool ig,
|
||||
bool ar,
|
||||
bool cf,
|
||||
explicit NodeBasedEdge(NodeID source,
|
||||
NodeID target,
|
||||
NodeID name_id,
|
||||
EdgeWeight weight,
|
||||
bool forward,
|
||||
bool backward,
|
||||
short type,
|
||||
bool roundabout,
|
||||
bool in_tiny_cc,
|
||||
bool access_restricted,
|
||||
bool contra_flow,
|
||||
bool is_split);
|
||||
|
||||
NodeID source;
|
||||
NodeID target;
|
||||
NodeID name;
|
||||
NodeID name_id;
|
||||
EdgeWeight weight;
|
||||
short type;
|
||||
bool forward : 1;
|
||||
bool backward : 1;
|
||||
bool roundabout : 1;
|
||||
bool ignoreInGrid : 1;
|
||||
bool accessRestricted : 1;
|
||||
bool contraFlow : 1;
|
||||
bool in_tiny_cc : 1;
|
||||
bool access_restricted : 1;
|
||||
bool contra_flow : 1;
|
||||
bool is_split : 1;
|
||||
|
||||
NodeBasedEdge() = delete;
|
||||
};
|
||||
|
||||
class EdgeBasedEdge
|
||||
struct EdgeBasedEdge
|
||||
{
|
||||
|
||||
public:
|
||||
bool operator<(const EdgeBasedEdge &e) const;
|
||||
|
||||
template <class EdgeT>
|
||||
explicit EdgeBasedEdge(const EdgeT &myEdge);
|
||||
template <class EdgeT> explicit EdgeBasedEdge(const EdgeT &myEdge);
|
||||
|
||||
/** Default constructor. target and weight are set to 0.*/
|
||||
EdgeBasedEdge();
|
||||
|
||||
explicit EdgeBasedEdge(const NodeID s,
|
||||
const NodeID t,
|
||||
const NodeID v,
|
||||
const EdgeWeight w,
|
||||
const bool f,
|
||||
const bool b);
|
||||
|
||||
NodeID target() const;
|
||||
NodeID source() const;
|
||||
EdgeWeight weight() const;
|
||||
NodeID id() const;
|
||||
bool isBackward() const;
|
||||
bool isForward() const;
|
||||
|
||||
private:
|
||||
NodeID m_source;
|
||||
NodeID m_target;
|
||||
NodeID m_edgeID;
|
||||
EdgeWeight m_weight : 30;
|
||||
bool m_forward : 1;
|
||||
bool m_backward : 1;
|
||||
explicit EdgeBasedEdge(const NodeID source,
|
||||
const NodeID target,
|
||||
const NodeID edge_id,
|
||||
const EdgeWeight weight,
|
||||
const bool forward,
|
||||
const bool backward);
|
||||
NodeID source;
|
||||
NodeID target;
|
||||
NodeID edge_id;
|
||||
EdgeWeight weight : 30;
|
||||
bool forward : 1;
|
||||
bool backward : 1;
|
||||
};
|
||||
|
||||
typedef NodeBasedEdge ImportEdge;
|
||||
|
||||
@@ -84,11 +84,11 @@ NodeBasedDynamicGraphFromImportEdges(int number_of_nodes, std::vector<ImportEdge
|
||||
BOOST_ASSERT(edge.data.distance > 0);
|
||||
edge.data.shortcut = false;
|
||||
edge.data.roundabout = import_edge.roundabout;
|
||||
edge.data.ignore_in_grid = import_edge.ignoreInGrid;
|
||||
edge.data.nameID = import_edge.name;
|
||||
edge.data.ignore_in_grid = import_edge.in_tiny_cc;
|
||||
edge.data.nameID = import_edge.name_id;
|
||||
edge.data.type = import_edge.type;
|
||||
edge.data.isAccessRestricted = import_edge.accessRestricted;
|
||||
edge.data.contraFlow = import_edge.contraFlow;
|
||||
edge.data.isAccessRestricted = import_edge.access_restricted;
|
||||
edge.data.contraFlow = import_edge.contra_flow;
|
||||
edges_list.push_back(edge);
|
||||
|
||||
if (!import_edge.is_split)
|
||||
|
||||
Reference in New Issue
Block a user