xrpld
Loading...
Searching...
No Matches
xrpl::PathRequestManager Class Reference

#include <PathRequestManager.h>

Collaboration diagram for xrpl::PathRequestManager:

Public Member Functions

 PathRequestManager (Application &app, beast::Journal journal, beast::insight::Collector::ptr const &collector)
 A collection of all PathRequest instances.
void updateAll (std::shared_ptr< ReadView const > const &ledger)
 Update all of the contained PathRequest instances.
bool requestsPending () const
std::shared_ptr< AssetCachegetAssetCache (std::shared_ptr< ReadView const > const &ledger, bool authoritative)
 Get the current AssetCache, updating it if necessary.
json::Value makePathRequest (std::shared_ptr< InfoSub > const &subscriber, std::shared_ptr< ReadView const > const &ledger, json::Value const &request)
json::Value makeLegacyPathRequest (PathRequest::pointer &req, std::function< void(void)> completion, Resource::Consumer &consumer, std::shared_ptr< ReadView const > const &inLedger, json::Value const &request)
json::Value doLegacyPathRequest (Resource::Consumer &consumer, std::shared_ptr< ReadView const > const &inLedger, json::Value const &request)
void reportFast (std::chrono::milliseconds ms)
void reportFull (std::chrono::milliseconds ms)

Private Member Functions

void insertPathRequest (PathRequest::pointer const &)

Private Attributes

Applicationapp_
beast::Journal journal_
beast::insight::Event fast_
beast::insight::Event full_
std::vector< PathRequest::wptrrequests_
std::weak_ptr< AssetCacheassetCache_
std::atomic< int > lastIdentifier_
std::recursive_mutex lock_

Detailed Description

Definition at line 13 of file PathRequestManager.h.

Constructor & Destructor Documentation

◆ PathRequestManager()

xrpl::PathRequestManager::PathRequestManager ( Application & app,
beast::Journal journal,
beast::insight::Collector::ptr const & collector )

A collection of all PathRequest instances.

Definition at line 17 of file PathRequestManager.h.

Member Function Documentation

◆ updateAll()

void xrpl::PathRequestManager::updateAll ( std::shared_ptr< ReadView const > const & ledger)

Update all of the contained PathRequest instances.

Parameters
ledgerLedger we are pathfinding in.

Definition at line 60 of file PathRequestManager.cpp.

◆ requestsPending()

bool xrpl::PathRequestManager::requestsPending ( ) const

Definition at line 208 of file PathRequestManager.cpp.

◆ getAssetCache()

std::shared_ptr< AssetCache > xrpl::PathRequestManager::getAssetCache ( std::shared_ptr< ReadView const > const & ledger,
bool authoritative )

Get the current AssetCache, updating it if necessary.

Get the correct ledger to use.

Definition at line 33 of file PathRequestManager.cpp.

◆ makePathRequest()

json::Value xrpl::PathRequestManager::makePathRequest ( std::shared_ptr< InfoSub > const & subscriber,
std::shared_ptr< ReadView const > const & ledger,
json::Value const & request )

Definition at line 233 of file PathRequestManager.cpp.

◆ makeLegacyPathRequest()

json::Value xrpl::PathRequestManager::makeLegacyPathRequest ( PathRequest::pointer & req,
std::function< void(void)> completion,
Resource::Consumer & consumer,
std::shared_ptr< ReadView const > const & inLedger,
json::Value const & request )

Definition at line 253 of file PathRequestManager.cpp.

◆ doLegacyPathRequest()

json::Value xrpl::PathRequestManager::doLegacyPathRequest ( Resource::Consumer & consumer,
std::shared_ptr< ReadView const > const & inLedger,
json::Value const & request )

Definition at line 286 of file PathRequestManager.cpp.

◆ reportFast()

void xrpl::PathRequestManager::reportFast ( std::chrono::milliseconds ms)

Definition at line 68 of file PathRequestManager.h.

◆ reportFull()

void xrpl::PathRequestManager::reportFull ( std::chrono::milliseconds ms)

Definition at line 74 of file PathRequestManager.h.

◆ insertPathRequest()

void xrpl::PathRequestManager::insertPathRequest ( PathRequest::pointer const & req)
private

Definition at line 215 of file PathRequestManager.cpp.

Member Data Documentation

◆ app_

Application& xrpl::PathRequestManager::app_
private

Definition at line 83 of file PathRequestManager.h.

◆ journal_

beast::Journal xrpl::PathRequestManager::journal_
private

Definition at line 84 of file PathRequestManager.h.

◆ fast_

beast::insight::Event xrpl::PathRequestManager::fast_
private

Definition at line 86 of file PathRequestManager.h.

◆ full_

beast::insight::Event xrpl::PathRequestManager::full_
private

Definition at line 87 of file PathRequestManager.h.

◆ requests_

std::vector<PathRequest::wptr> xrpl::PathRequestManager::requests_
private

Definition at line 90 of file PathRequestManager.h.

◆ assetCache_

std::weak_ptr<AssetCache> xrpl::PathRequestManager::assetCache_
private

Definition at line 93 of file PathRequestManager.h.

◆ lastIdentifier_

std::atomic<int> xrpl::PathRequestManager::lastIdentifier_
private

Definition at line 95 of file PathRequestManager.h.

◆ lock_

std::recursive_mutex xrpl::PathRequestManager::lock_
mutableprivate

Definition at line 97 of file PathRequestManager.h.