Add opperator==() for PathNodes.

This commit is contained in:
Arthur Britto
2012-12-05 17:28:16 -08:00
parent 7871df819a
commit 4b6b1eebd9
2 changed files with 14 additions and 0 deletions

View File

@@ -27,6 +27,14 @@ std::size_t hash_value(const aciSource& asValue)
return seed; return seed;
} }
// Compare the non-calculated fields.
bool PaymentNode::operator==(const PaymentNode& pnOther) const {
return pnOther.uFlags == uFlags
&& pnOther.uAccountID == uAccountID
&& pnOther.uCurrencyID == uCurrencyID
&& pnOther.uIssuerID == uIssuerID;
}
// //
// PathState implementation // PathState implementation
// //
@@ -272,6 +280,8 @@ TER PathState::pushNode(
return terResult; return terResult;
} }
// Set to an expanded path.
//
// terStatus = tesSUCCESS, temBAD_PATH, terNO_LINE, or temBAD_PATH_LOOP // terStatus = tesSUCCESS, temBAD_PATH, terNO_LINE, or temBAD_PATH_LOOP
void PathState::setExpanded( void PathState::setExpanded(
const LedgerEntrySet& lesSource, const LedgerEntrySet& lesSource,
@@ -428,6 +438,7 @@ cLog(lsDEBUG) << boost::str(boost::format("PathState: receiver implied: account=
% getJson()); % getJson());
} }
// Set to a canonical path.
void PathState::setCanonical( void PathState::setCanonical(
const PathState& psExpanded const PathState& psExpanded
) )

View File

@@ -53,6 +53,9 @@ protected:
STAmount saOfferFunds; STAmount saOfferFunds;
STAmount saTakerPays; STAmount saTakerPays;
STAmount saTakerGets; STAmount saTakerGets;
public:
bool operator==(const PaymentNode& pnOther) const;
}; };
// account id, currency id, issuer id :: node // account id, currency id, issuer id :: node