mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
New improved Pathfinding engine
This commit is contained in:
@@ -1164,6 +1164,12 @@ public:
|
||||
;
|
||||
}
|
||||
|
||||
STPathElement ()
|
||||
: mType (0)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
int getNodeType () const
|
||||
{
|
||||
return mType;
|
||||
@@ -1193,8 +1199,8 @@ public:
|
||||
|
||||
bool operator== (const STPathElement& t) const
|
||||
{
|
||||
return mType == t.mType && mAccountID == t.mAccountID && mCurrencyID == t.mCurrencyID &&
|
||||
mIssuerID == t.mIssuerID;
|
||||
return ((mType & typeAccount) == (t.mType & typeAccount)) &&
|
||||
(mAccountID == t.mAccountID) && (mCurrencyID == t.mCurrencyID) && (mIssuerID == t.mIssuerID);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -1368,6 +1374,15 @@ public:
|
||||
{
|
||||
value.push_back (e);
|
||||
}
|
||||
void addUniquePath (const STPath& e)
|
||||
{
|
||||
BOOST_FOREACH(const STPath& p, value)
|
||||
{
|
||||
if (p == e)
|
||||
return;
|
||||
}
|
||||
value.push_back (e);
|
||||
}
|
||||
|
||||
bool assembleAdd(STPath const& base, STPathElement const& tail)
|
||||
{ // assemble base+tail and add it to the set if it's not a duplicate
|
||||
@@ -1398,6 +1413,15 @@ public:
|
||||
|
||||
void printDebug ();
|
||||
|
||||
STPath& operator[](size_t n)
|
||||
{
|
||||
return value[n];
|
||||
}
|
||||
STPath const& operator[](size_t n) const
|
||||
{
|
||||
return value[n];
|
||||
}
|
||||
|
||||
std::vector<STPath>::iterator begin ()
|
||||
{
|
||||
return value.begin ();
|
||||
|
||||
Reference in New Issue
Block a user