rippled
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ripple::PathRequests Class Reference
Collaboration diagram for ripple::PathRequests:
Collaboration graph
[legend]

Public Member Functions

 PathRequests (Application &app, beast::Journal journal, beast::insight::Collector::ptr const &collector)
 A collection of all PathRequest instances. More...
 
void updateAll (std::shared_ptr< ReadView const > const &ledger)
 Update all of the contained PathRequest instances. More...
 
bool requestsPending () const
 
std::shared_ptr< RippleLineCachegetLineCache (std::shared_ptr< ReadView const > const &ledger, bool authoritative)
 Get the current RippleLineCache, updating it if necessary. More...
 
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 33 of file PathRequests.h.

Constructor & Destructor Documentation

◆ PathRequests()

ripple::PathRequests::PathRequests ( Application app,
beast::Journal  journal,
beast::insight::Collector::ptr const &  collector 
)

A collection of all PathRequest instances.

Definition at line 37 of file PathRequests.h.

Member Function Documentation

◆ updateAll()

void ripple::PathRequests::updateAll ( std::shared_ptr< ReadView const > const &  ledger)

Update all of the contained PathRequest instances.

Parameters
ledgerLedger we are pathfinding in.

Definition at line 68 of file PathRequests.cpp.

◆ requestsPending()

bool ripple::PathRequests::requestsPending ( ) const

Definition at line 219 of file PathRequests.cpp.

◆ getLineCache()

std::shared_ptr< RippleLineCache > ripple::PathRequests::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 37 of file PathRequests.cpp.

◆ makePathRequest()

Json::Value ripple::PathRequests::makePathRequest ( std::shared_ptr< InfoSub > const &  subscriber,
std::shared_ptr< ReadView const > const &  ledger,
Json::Value const &  request 
)

Definition at line 245 of file PathRequests.cpp.

◆ makeLegacyPathRequest()

Json::Value ripple::PathRequests::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 267 of file PathRequests.cpp.

◆ doLegacyPathRequest()

Json::Value ripple::PathRequests::doLegacyPathRequest ( Resource::Consumer consumer,
std::shared_ptr< ReadView const > const &  inLedger,
Json::Value const &  request 
)

Definition at line 300 of file PathRequests.cpp.

◆ reportFast()

void ripple::PathRequests::reportFast ( std::chrono::milliseconds  ms)

Definition at line 90 of file PathRequests.h.

◆ reportFull()

void ripple::PathRequests::reportFull ( std::chrono::milliseconds  ms)

Definition at line 96 of file PathRequests.h.

◆ insertPathRequest()

void ripple::PathRequests::insertPathRequest ( PathRequest::pointer const &  req)
private

Definition at line 226 of file PathRequests.cpp.

Member Data Documentation

◆ app_

Application& ripple::PathRequests::app_
private

Definition at line 105 of file PathRequests.h.

◆ mJournal

beast::Journal ripple::PathRequests::mJournal
private

Definition at line 106 of file PathRequests.h.

◆ mFast

beast::insight::Event ripple::PathRequests::mFast
private

Definition at line 108 of file PathRequests.h.

◆ mFull

beast::insight::Event ripple::PathRequests::mFull
private

Definition at line 109 of file PathRequests.h.

◆ requests_

std::vector<PathRequest::wptr> ripple::PathRequests::requests_
private

Definition at line 112 of file PathRequests.h.

◆ lineCache_

std::weak_ptr<RippleLineCache> ripple::PathRequests::lineCache_
private

Definition at line 115 of file PathRequests.h.

◆ mLastIdentifier

std::atomic<int> ripple::PathRequests::mLastIdentifier
private

Definition at line 117 of file PathRequests.h.

◆ mLock

std::recursive_mutex ripple::PathRequests::mLock
mutableprivate

Definition at line 119 of file PathRequests.h.