rippled
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ripple::PathRequest Class Referencefinal

#include <PathRequest.h>

Inheritance diagram for ripple::PathRequest:
Inheritance graph
[legend]
Collaboration diagram for ripple::PathRequest:
Collaboration graph
[legend]

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, PathRequests &, beast::Journal journal)
 
 PathRequest (Application &app, std::function< void(void)> const &completion, Resource::Consumer &consumer, int id, PathRequests &, beast::Journal journal)
 
 ~PathRequest ()
 
bool isNew ()
 
bool needsUpdate (bool newOnly, LedgerIndex index)
 
void updateComplete ()
 
std::pair< bool, Json::ValuedoCreate (std::shared_ptr< RippleLineCache > const &, Json::Value const &)
 
Json::Value doClose () override
 
Json::Value doStatus (Json::Value const &) override
 
void doAborting () const
 
Json::Value doUpdate (std::shared_ptr< RippleLineCache > 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)
 

Private Member Functions

bool isValid (std::shared_ptr< RippleLineCache > const &crCache)
 
std::unique_ptr< Pathfinder > const & getPathFinder (std::shared_ptr< RippleLineCache > const &, hash_map< Currency, std::unique_ptr< Pathfinder > > &, Currency const &, STAmount const &, int const, std::function< bool(void)> const &)
 
bool findPaths (std::shared_ptr< RippleLineCache > 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 m_journal
 
std::recursive_mutex mLock
 
PathRequestsmOwner
 
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< IssuesciSourceCurrencies
 
std::map< Issue, STPathSetmContext
 
std::optional< uint256domain
 
bool convert_all_
 
std::recursive_mutex mIndexLock
 
LedgerIndex mLastIndex
 
bool mInProgress
 
int iLevel
 
bool bLastSuccess
 
int const iIdentifier
 
std::chrono::steady_clock::time_point const created_
 
std::chrono::steady_clock::time_point quick_reply_
 
std::chrono::steady_clock::time_point full_reply_
 

Static Private Attributes

static unsigned int const max_paths_ = 4
 

Detailed Description

Definition at line 49 of file PathRequest.h.

Member Typedef Documentation

◆ wptr

Definition at line 54 of file PathRequest.h.

◆ pointer

Definition at line 55 of file PathRequest.h.

◆ ref

Definition at line 56 of file PathRequest.h.

◆ wref

Definition at line 57 of file PathRequest.h.

Constructor & Destructor Documentation

◆ PathRequest() [1/2]

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

Definition at line 42 of file PathRequest.cpp.

◆ PathRequest() [2/2]

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

Definition at line 64 of file PathRequest.cpp.

◆ ~PathRequest()

ripple::PathRequest::~PathRequest ( )

Definition at line 87 of file PathRequest.cpp.

Member Function Documentation

◆ isNew()

bool ripple::PathRequest::isNew ( )

Definition at line 116 of file PathRequest.cpp.

◆ needsUpdate()

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

Definition at line 125 of file PathRequest.cpp.

◆ updateComplete()

void ripple::PathRequest::updateComplete ( )

Definition at line 157 of file PathRequest.cpp.

◆ doCreate()

std::pair< bool, Json::Value > ripple::PathRequest::doCreate ( std::shared_ptr< RippleLineCache > const &  cache,
Json::Value const &  value 
)

Definition at line 244 of file PathRequest.cpp.

◆ doClose()

Json::Value ripple::PathRequest::doClose ( )
overridevirtual

Implements ripple::InfoSubRequest.

Definition at line 459 of file PathRequest.cpp.

◆ doStatus()

Json::Value ripple::PathRequest::doStatus ( Json::Value const &  )
overridevirtual

Implements ripple::InfoSubRequest.

Definition at line 468 of file PathRequest.cpp.

◆ doAborting()

void ripple::PathRequest::doAborting ( ) const

Definition at line 476 of file PathRequest.cpp.

◆ doUpdate()

Json::Value ripple::PathRequest::doUpdate ( std::shared_ptr< RippleLineCache > const &  cache,
bool  fast,
std::function< bool(void)> const &  continueCallback = {} 
)

Definition at line 674 of file PathRequest.cpp.

◆ getSubscriber()

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

Definition at line 779 of file PathRequest.cpp.

◆ hasCompletion()

bool ripple::PathRequest::hasCompletion ( )

Definition at line 151 of file PathRequest.cpp.

◆ isValid()

bool ripple::PathRequest::isValid ( std::shared_ptr< RippleLineCache > const &  crCache)
private

Definition at line 173 of file PathRequest.cpp.

◆ getPathFinder()

std::unique_ptr< Pathfinder > const & ripple::PathRequest::getPathFinder ( std::shared_ptr< RippleLineCache > const &  cache,
hash_map< Currency, std::unique_ptr< Pathfinder > > &  currency_map,
Currency const &  currency,
STAmount const &  dst_amount,
int const  level,
std::function< bool(void)> const &  continueCallback 
)
private

Definition at line 482 of file PathRequest.cpp.

◆ findPaths()

bool ripple::PathRequest::findPaths ( std::shared_ptr< RippleLineCache > 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 inavlid.

Definition at line 511 of file PathRequest.cpp.

◆ parseJson()

int ripple::PathRequest::parseJson ( Json::Value const &  jvParams)
private

Definition at line 274 of file PathRequest.cpp.

◆ getCounter()

static auto & ripple::CountedObject< InfoSubRequest >::getCounter ( )
staticprivatenoexceptinherited

Definition at line 129 of file CountedObject.h.

Member Data Documentation

◆ app_

Application& ripple::PathRequest::app_
private

Definition at line 137 of file PathRequest.h.

◆ m_journal

beast::Journal ripple::PathRequest::m_journal
private

Definition at line 138 of file PathRequest.h.

◆ mLock

std::recursive_mutex ripple::PathRequest::mLock
private

Definition at line 140 of file PathRequest.h.

◆ mOwner

PathRequests& ripple::PathRequest::mOwner
private

Definition at line 142 of file PathRequest.h.

◆ wpSubscriber

std::weak_ptr<InfoSub> ripple::PathRequest::wpSubscriber
private

Definition at line 144 of file PathRequest.h.

◆ fCompletion

std::function<void(void)> ripple::PathRequest::fCompletion
private

Definition at line 145 of file PathRequest.h.

◆ consumer_

Resource::Consumer& ripple::PathRequest::consumer_
private

Definition at line 146 of file PathRequest.h.

◆ jvId

Json::Value ripple::PathRequest::jvId
private

Definition at line 148 of file PathRequest.h.

◆ jvStatus

Json::Value ripple::PathRequest::jvStatus
private

Definition at line 149 of file PathRequest.h.

◆ raSrcAccount

std::optional<AccountID> ripple::PathRequest::raSrcAccount
private

Definition at line 152 of file PathRequest.h.

◆ raDstAccount

std::optional<AccountID> ripple::PathRequest::raDstAccount
private

Definition at line 153 of file PathRequest.h.

◆ saDstAmount

STAmount ripple::PathRequest::saDstAmount
private

Definition at line 154 of file PathRequest.h.

◆ saSendMax

std::optional<STAmount> ripple::PathRequest::saSendMax
private

Definition at line 155 of file PathRequest.h.

◆ sciSourceCurrencies

std::set<Issue> ripple::PathRequest::sciSourceCurrencies
private

Definition at line 157 of file PathRequest.h.

◆ mContext

std::map<Issue, STPathSet> ripple::PathRequest::mContext
private

Definition at line 158 of file PathRequest.h.

◆ domain

std::optional<uint256> ripple::PathRequest::domain
private

Definition at line 160 of file PathRequest.h.

◆ convert_all_

bool ripple::PathRequest::convert_all_
private

Definition at line 162 of file PathRequest.h.

◆ mIndexLock

std::recursive_mutex ripple::PathRequest::mIndexLock
private

Definition at line 164 of file PathRequest.h.

◆ mLastIndex

LedgerIndex ripple::PathRequest::mLastIndex
private

Definition at line 165 of file PathRequest.h.

◆ mInProgress

bool ripple::PathRequest::mInProgress
private

Definition at line 166 of file PathRequest.h.

◆ iLevel

int ripple::PathRequest::iLevel
private

Definition at line 168 of file PathRequest.h.

◆ bLastSuccess

bool ripple::PathRequest::bLastSuccess
private

Definition at line 169 of file PathRequest.h.

◆ iIdentifier

int const ripple::PathRequest::iIdentifier
private

Definition at line 171 of file PathRequest.h.

◆ created_

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

Definition at line 173 of file PathRequest.h.

◆ quick_reply_

std::chrono::steady_clock::time_point ripple::PathRequest::quick_reply_
private

Definition at line 174 of file PathRequest.h.

◆ full_reply_

std::chrono::steady_clock::time_point ripple::PathRequest::full_reply_
private

Definition at line 175 of file PathRequest.h.

◆ max_paths_

unsigned int const ripple::PathRequest::max_paths_ = 4
staticprivate

Definition at line 177 of file PathRequest.h.