20 #ifndef RIPPLE_APP_PATHS_PATHFINDER_H_INCLUDED
21 #define RIPPLE_APP_PATHS_PATHFINDER_H_INCLUDED
23 #include <ripple/app/ledger/Ledger.h>
24 #include <ripple/app/paths/RippleLineCache.h>
25 #include <ripple/basics/CountedObject.h>
26 #include <ripple/core/LoadEvent.h>
27 #include <ripple/protocol/STAmount.h>
28 #include <ripple/protocol/STPathSet.h>
154 STPath const& currentPath,
175 uint64_t& qualityOut)
const;
STPathSet & addPathsForType(PathType const &type, std::function< bool(void)> const &continueCallback)
Tracks the number of instances of an object.
void addLink(STPath const ¤tPath, STPathSet &incompletePaths, int addFlags, std::function< bool(void)> const &continueCallback)
A currency issued by an account.
static const std::uint32_t afADD_ACCOUNTS
LineDirection
Describes how an account was found in a path, and how to find the next set of paths.
Calculates payment paths.
void addLinks(STPathSet const ¤tPaths, STPathSet &incompletePaths, int addFlags, std::function< bool(void)> const &continueCallback)
void computePathRanks(int maxPaths, std::function< bool(void)> const &continueCallback={})
Compute the rankings of the paths.
static const std::uint32_t afOB_LAST
std::map< PathType, STPathSet > mPaths
static void initPathTable()
bool findPaths(int searchLevel, std::function< bool(void)> const &continueCallback={})
int getPathsOut(Currency const ¤cy, AccountID const &account, LineDirection direction, bool isDestCurrency, AccountID const &dest, std::function< bool(void)> const &continueCallback)
bool isNoRipple(AccountID const &fromAccount, AccountID const &toAccount, Currency const ¤cy)
TER getPathLiquidity(STPath const &path, STAmount const &minDstAmount, STAmount &amountOut, uint64_t &qualityOut) const
static const std::uint32_t afAC_LAST
Integers of any length that is a multiple of 32-bits.
Pathfinder & operator=(Pathfinder const &)=delete
std::optional< AccountID > mSrcIssuer
std::shared_ptr< ReadView const > mLedger
std::shared_ptr< RippleLineCache > mRLCache
Pathfinder(std::shared_ptr< RippleLineCache > const &cache, AccountID const &srcAccount, AccountID const &dstAccount, Currency const &uSrcCurrency, std::optional< AccountID > const &uSrcIssuer, STAmount const &dstAmount, std::optional< STAmount > const &srcAmount, Application &app)
Construct a pathfinder without an issuer.
A generic endpoint for log messages.
std::unique_ptr< LoadEvent > m_loadEvent
STAmount mRemainingAmount
The amount remaining from mSrcAccount after the default liquidity has been removed.
STPathSet getBestPaths(int maxPaths, STPath &fullLiquidityPath, STPathSet const &extraPaths, AccountID const &srcIssuer, std::function< bool(void)> const &continueCallback={})
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
static const std::uint32_t afOB_XRP
bool issueMatchesOrigin(Issue const &)
static const std::uint32_t afADD_BOOKS
bool isNoRippleOut(STPath const ¤tPath)
hash_map< Issue, int > mPathsOutCountMap
std::vector< PathRank > mPathRanks
void rankPaths(int maxPaths, STPathSet const &paths, std::vector< PathRank > &rankedPaths, std::function< bool(void)> const &continueCallback)