xrpld
Loading...
Searching...
No Matches
xrpl::PathRequest Class Referencefinal

#include <PathRequest.h>

Inheritance diagram for xrpl::PathRequest:
Collaboration diagram for xrpl::PathRequest:

Public Types

using wptr = std::weak_ptr<PathRequest>
using pointer = std::shared_ptr<PathRequest>
using ref = pointer const&
using wref = wptr const&

Public Member Functions

 PathRequest (Application &app, std::shared_ptr< InfoSub > const &subscriber, int id, PathRequestManager &, beast::Journal journal)
 PathRequest (Application &app, std::function< void(void)> completion, Resource::Consumer &consumer, int id, PathRequestManager &, beast::Journal journal)
 ~PathRequest () override
bool isNew ()
bool needsUpdate (bool newOnly, LedgerIndex index)
void updateComplete ()
std::pair< bool, json::ValuedoCreate (std::shared_ptr< AssetCache > const &, json::Value const &)
json::Value doClose () override
json::Value doStatus (json::Value const &) override
void doAborting () const
json::Value doUpdate (std::shared_ptr< AssetCache > const &, bool fast, std::function< bool(void)> const &continueCallback={})
InfoSub::pointer getSubscriber () const
bool hasCompletion ()
shared_from_this (T... args)
weak_from_this (T... args)

Public Attributes

friend Object
friend Object

Private Member Functions

bool isValid (std::shared_ptr< AssetCache > const &crCache)
std::unique_ptr< Pathfinder > const & getPathFinder (std::shared_ptr< AssetCache > const &, hash_map< PathAsset, std::unique_ptr< Pathfinder > > &, PathAsset const &, STAmount const &, int const, std::function< bool(void)> const &)
bool findPaths (std::shared_ptr< AssetCache > const &, int const, json::Value &, std::function< bool(void)> const &)
 Finds and sets a PathSet in the JSON argument.
int parseJson (json::Value const &)

Static Private Member Functions

static auto & getCounter () noexcept

Private Attributes

Applicationapp_
beast::Journal journal_
std::recursive_mutex lock_
PathRequestManagerowner_
std::weak_ptr< InfoSubwpSubscriber_
std::function< void(void)> fCompletion_
Resource::Consumerconsumer_
json::Value jvId_
json::Value jvStatus_
std::optional< AccountIDraSrcAccount_
std::optional< AccountIDraDstAccount_
STAmount saDstAmount_
std::optional< STAmountsaSendMax_
std::set< AssetsciSourceAssets_
std::map< Asset, STPathSetcontext_
std::optional< uint256domain_
bool convertAll_ {}
std::recursive_mutex indexLock_
LedgerIndex lastIndex_
bool inProgress_
int iLevel_
bool bLastSuccess_
int const iIdentifier_
std::chrono::steady_clock::time_point const created_
std::chrono::steady_clock::time_point quickReply_
std::chrono::steady_clock::time_point fullReply_

Static Private Attributes

static unsigned int const kMaxPaths = 4

Detailed Description

Definition at line 30 of file PathRequest.h.

Member Typedef Documentation

◆ wptr

Definition at line 35 of file PathRequest.h.

◆ pointer

◆ ref

Definition at line 37 of file PathRequest.h.

◆ wref

using xrpl::PathRequest::wref = wptr const&

Definition at line 38 of file PathRequest.h.

Constructor & Destructor Documentation

◆ PathRequest() [1/2]

xrpl::PathRequest::PathRequest ( Application & app,
std::shared_ptr< InfoSub > const & subscriber,
int id,
PathRequestManager & owner,
beast::Journal journal )

Definition at line 51 of file PathRequest.cpp.

◆ PathRequest() [2/2]

xrpl::PathRequest::PathRequest ( Application & app,
std::function< void(void)> completion,
Resource::Consumer & consumer,
int id,
PathRequestManager & owner,
beast::Journal journal )

Definition at line 73 of file PathRequest.cpp.

◆ ~PathRequest()

xrpl::PathRequest::~PathRequest ( )
override

Definition at line 96 of file PathRequest.cpp.

Member Function Documentation

◆ isNew()

bool xrpl::PathRequest::isNew ( )

Definition at line 122 of file PathRequest.cpp.

◆ needsUpdate()

bool xrpl::PathRequest::needsUpdate ( bool newOnly,
LedgerIndex index )

Definition at line 131 of file PathRequest.cpp.

◆ updateComplete()

void xrpl::PathRequest::updateComplete ( )

Definition at line 163 of file PathRequest.cpp.

◆ doCreate()

std::pair< bool, json::Value > xrpl::PathRequest::doCreate ( std::shared_ptr< AssetCache > const & cache,
json::Value const & value )

Definition at line 247 of file PathRequest.cpp.

◆ doClose()

json::Value xrpl::PathRequest::doClose ( )
overridevirtual

Implements xrpl::InfoSubRequest.

Definition at line 478 of file PathRequest.cpp.

◆ doStatus()

json::Value xrpl::PathRequest::doStatus ( json::Value const & )
overridevirtual

Implements xrpl::InfoSubRequest.

Definition at line 487 of file PathRequest.cpp.

◆ doAborting()

void xrpl::PathRequest::doAborting ( ) const

Definition at line 495 of file PathRequest.cpp.

◆ doUpdate()

json::Value xrpl::PathRequest::doUpdate ( std::shared_ptr< AssetCache > const & cache,
bool fast,
std::function< bool(void)> const & continueCallback = {} )

Definition at line 713 of file PathRequest.cpp.

◆ getSubscriber()

InfoSub::pointer xrpl::PathRequest::getSubscriber ( ) const

Definition at line 822 of file PathRequest.cpp.

◆ hasCompletion()

bool xrpl::PathRequest::hasCompletion ( )

Definition at line 157 of file PathRequest.cpp.

◆ isValid()

bool xrpl::PathRequest::isValid ( std::shared_ptr< AssetCache > const & crCache)
private

Definition at line 178 of file PathRequest.cpp.

◆ getPathFinder()

std::unique_ptr< Pathfinder > const & xrpl::PathRequest::getPathFinder ( std::shared_ptr< AssetCache > const & cache,
hash_map< PathAsset, std::unique_ptr< Pathfinder > > & currencyMap,
PathAsset const & currency,
STAmount const & dstAmount,
int const level,
std::function< bool(void)> const & continueCallback )
private

Definition at line 501 of file PathRequest.cpp.

◆ findPaths()

bool xrpl::PathRequest::findPaths ( std::shared_ptr< AssetCache > const & cache,
int const level,
json::Value & jvArray,
std::function< bool(void)> const & continueCallback )
private

Finds and sets a PathSet in the JSON argument.

Returns false if the source currencies are invalid.

Definition at line 536 of file PathRequest.cpp.

◆ parseJson()

int xrpl::PathRequest::parseJson ( json::Value const & jvParams)
private

Definition at line 275 of file PathRequest.cpp.

◆ getCounter()

auto & xrpl::CountedObject< InfoSubRequest >::getCounter ( )
staticprivatenoexceptinherited

Definition at line 109 of file CountedObject.h.

Member Data Documentation

◆ app_

Application& xrpl::PathRequest::app_
private

Definition at line 118 of file PathRequest.h.

◆ journal_

beast::Journal xrpl::PathRequest::journal_
private

Definition at line 119 of file PathRequest.h.

◆ lock_

std::recursive_mutex xrpl::PathRequest::lock_
private

Definition at line 121 of file PathRequest.h.

◆ owner_

PathRequestManager& xrpl::PathRequest::owner_
private

Definition at line 123 of file PathRequest.h.

◆ wpSubscriber_

std::weak_ptr<InfoSub> xrpl::PathRequest::wpSubscriber_
private

Definition at line 125 of file PathRequest.h.

◆ fCompletion_

std::function<void(void)> xrpl::PathRequest::fCompletion_
private

Definition at line 126 of file PathRequest.h.

◆ consumer_

Resource::Consumer& xrpl::PathRequest::consumer_
private

Definition at line 127 of file PathRequest.h.

◆ jvId_

json::Value xrpl::PathRequest::jvId_
private

Definition at line 129 of file PathRequest.h.

◆ jvStatus_

json::Value xrpl::PathRequest::jvStatus_
private

Definition at line 130 of file PathRequest.h.

◆ raSrcAccount_

std::optional<AccountID> xrpl::PathRequest::raSrcAccount_
private

Definition at line 133 of file PathRequest.h.

◆ raDstAccount_

std::optional<AccountID> xrpl::PathRequest::raDstAccount_
private

Definition at line 134 of file PathRequest.h.

◆ saDstAmount_

STAmount xrpl::PathRequest::saDstAmount_
private

Definition at line 135 of file PathRequest.h.

◆ saSendMax_

std::optional<STAmount> xrpl::PathRequest::saSendMax_
private

Definition at line 136 of file PathRequest.h.

◆ sciSourceAssets_

std::set<Asset> xrpl::PathRequest::sciSourceAssets_
private

Definition at line 138 of file PathRequest.h.

◆ context_

std::map<Asset, STPathSet> xrpl::PathRequest::context_
private

Definition at line 139 of file PathRequest.h.

◆ domain_

std::optional<uint256> xrpl::PathRequest::domain_
private

Definition at line 141 of file PathRequest.h.

◆ convertAll_

bool xrpl::PathRequest::convertAll_ {}
private

Definition at line 143 of file PathRequest.h.

◆ indexLock_

std::recursive_mutex xrpl::PathRequest::indexLock_
private

Definition at line 145 of file PathRequest.h.

◆ lastIndex_

LedgerIndex xrpl::PathRequest::lastIndex_
private

Definition at line 146 of file PathRequest.h.

◆ inProgress_

bool xrpl::PathRequest::inProgress_
private

Definition at line 147 of file PathRequest.h.

◆ iLevel_

int xrpl::PathRequest::iLevel_
private

Definition at line 149 of file PathRequest.h.

◆ bLastSuccess_

bool xrpl::PathRequest::bLastSuccess_
private

Definition at line 150 of file PathRequest.h.

◆ iIdentifier_

int const xrpl::PathRequest::iIdentifier_
private

Definition at line 152 of file PathRequest.h.

◆ created_

std::chrono::steady_clock::time_point const xrpl::PathRequest::created_
private

Definition at line 154 of file PathRequest.h.

◆ quickReply_

std::chrono::steady_clock::time_point xrpl::PathRequest::quickReply_
private

Definition at line 155 of file PathRequest.h.

◆ fullReply_

std::chrono::steady_clock::time_point xrpl::PathRequest::fullReply_
private

Definition at line 156 of file PathRequest.h.

◆ kMaxPaths

unsigned int const xrpl::PathRequest::kMaxPaths = 4
staticprivate

Definition at line 158 of file PathRequest.h.

◆ Object [1/2]

Definition at line 134 of file CountedObject.h.

◆ Object [2/2]

Definition at line 134 of file CountedObject.h.