rippled
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
xrpl::PathRequestManager Class Reference

#include <PathRequestManager.h>

Collaboration diagram for xrpl::PathRequestManager:
Collaboration graph
[legend]

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< RippleLineCachegetLineCache (std::shared_ptr< ReadView const > const &ledger, bool authoritative)
 Get the current RippleLineCache, 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 mJournal
 
beast::insight::Event mFast
 
beast::insight::Event mFull
 
std::vector< PathRequest::wptrrequests_
 
std::weak_ptr< RippleLineCachelineCache_
 
std::atomic< int > mLastIdentifier
 
std::recursive_mutex mLock
 

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 45 of file PathRequestManager.cpp.

◆ requestsPending()

bool xrpl::PathRequestManager::requestsPending ( ) const

Definition at line 193 of file PathRequestManager.cpp.

◆ getLineCache()

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

Get the current RippleLineCache, updating it if necessary.

Get the correct ledger to use.

Definition at line 18 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 218 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 238 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 271 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 200 of file PathRequestManager.cpp.

Member Data Documentation

◆ app_

Application& xrpl::PathRequestManager::app_
private

Definition at line 83 of file PathRequestManager.h.

◆ mJournal

beast::Journal xrpl::PathRequestManager::mJournal
private

Definition at line 84 of file PathRequestManager.h.

◆ mFast

beast::insight::Event xrpl::PathRequestManager::mFast
private

Definition at line 86 of file PathRequestManager.h.

◆ mFull

beast::insight::Event xrpl::PathRequestManager::mFull
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.

◆ lineCache_

std::weak_ptr<RippleLineCache> xrpl::PathRequestManager::lineCache_
private

Definition at line 93 of file PathRequestManager.h.

◆ mLastIdentifier

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

Definition at line 95 of file PathRequestManager.h.

◆ mLock

std::recursive_mutex xrpl::PathRequestManager::mLock
mutableprivate

Definition at line 97 of file PathRequestManager.h.