rippled
Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ripple::PathRequest Class Reference
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 = const pointer &
 
using wref = const wptr &
 

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 (Json::Value const &)
 
Json::Value doStatus (Json::Value const &)
 
Json::Value doUpdate (std::shared_ptr< RippleLineCache > const &, bool fast)
 
InfoSub::pointer getSubscriber ()
 
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)
 
bool findPaths (std::shared_ptr< RippleLineCache > const &, int const, Json::Value &)
 Finds and sets a PathSet in the JSON argument. More...
 
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
 
boost::optional< AccountIDraSrcAccount
 
boost::optional< AccountIDraDstAccount
 
STAmount saDstAmount
 
boost::optional< STAmountsaSendMax
 
std::set< IssuesciSourceCurrencies
 
std::map< Issue, STPathSetmContext
 
bool convert_all_
 
std::recursive_mutex mIndexLock
 
LedgerIndex mLastIndex
 
bool mInProgress
 
int iLevel
 
bool bLastSuccess
 
int iIdentifier
 
const std::chrono::steady_clock::time_point created_
 
std::chrono::steady_clock::time_point quick_reply_
 
std::chrono::steady_clock::time_point full_reply_
 

Static Private Attributes

static unsigned const int max_paths_ = 4
 

Detailed Description

Definition at line 48 of file PathRequest.h.

Member Typedef Documentation

◆ wptr

Definition at line 52 of file PathRequest.h.

◆ pointer

Definition at line 53 of file PathRequest.h.

◆ ref

Definition at line 54 of file PathRequest.h.

◆ wref

Definition at line 55 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 43 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 65 of file PathRequest.cpp.

◆ ~PathRequest()

ripple::PathRequest::~PathRequest ( )

Definition at line 88 of file PathRequest.cpp.

Member Function Documentation

◆ isNew()

bool ripple::PathRequest::isNew ( )

Definition at line 117 of file PathRequest.cpp.

◆ needsUpdate()

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

Definition at line 126 of file PathRequest.cpp.

◆ updateComplete()

void ripple::PathRequest::updateComplete ( )

Definition at line 158 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 245 of file PathRequest.cpp.

◆ doClose()

Json::Value ripple::PathRequest::doClose ( Json::Value const &  )

Definition at line 445 of file PathRequest.cpp.

◆ doStatus()

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

Definition at line 454 of file PathRequest.cpp.

◆ doUpdate()

Json::Value ripple::PathRequest::doUpdate ( std::shared_ptr< RippleLineCache > const &  cache,
bool  fast 
)

Definition at line 633 of file PathRequest.cpp.

◆ getSubscriber()

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

Definition at line 735 of file PathRequest.cpp.

◆ hasCompletion()

bool ripple::PathRequest::hasCompletion ( )

Definition at line 152 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 
)
private

Definition at line 462 of file PathRequest.cpp.

◆ findPaths()

bool ripple::PathRequest::findPaths ( std::shared_ptr< RippleLineCache > const &  cache,
int const  level,
Json::Value jvArray 
)
private

Finds and sets a PathSet in the JSON argument.

Returns false if the source currencies are inavlid.

Definition at line 489 of file PathRequest.cpp.

◆ parseJson()

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

Definition at line 275 of file PathRequest.cpp.

◆ getCounter()

static auto& ripple::CountedObject< PathRequest >::getCounter
staticprivatenoexceptinherited

Definition at line 128 of file CountedObject.h.

Member Data Documentation

◆ app_

Application& ripple::PathRequest::app_
private

Definition at line 127 of file PathRequest.h.

◆ m_journal

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

Definition at line 128 of file PathRequest.h.

◆ mLock

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

Definition at line 130 of file PathRequest.h.

◆ mOwner

PathRequests& ripple::PathRequest::mOwner
private

Definition at line 132 of file PathRequest.h.

◆ wpSubscriber

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

Definition at line 134 of file PathRequest.h.

◆ fCompletion

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

Definition at line 135 of file PathRequest.h.

◆ consumer_

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

Definition at line 136 of file PathRequest.h.

◆ jvId

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

Definition at line 138 of file PathRequest.h.

◆ jvStatus

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

Definition at line 139 of file PathRequest.h.

◆ raSrcAccount

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

Definition at line 142 of file PathRequest.h.

◆ raDstAccount

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

Definition at line 143 of file PathRequest.h.

◆ saDstAmount

STAmount ripple::PathRequest::saDstAmount
private

Definition at line 144 of file PathRequest.h.

◆ saSendMax

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

Definition at line 145 of file PathRequest.h.

◆ sciSourceCurrencies

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

Definition at line 147 of file PathRequest.h.

◆ mContext

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

Definition at line 148 of file PathRequest.h.

◆ convert_all_

bool ripple::PathRequest::convert_all_
private

Definition at line 150 of file PathRequest.h.

◆ mIndexLock

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

Definition at line 152 of file PathRequest.h.

◆ mLastIndex

LedgerIndex ripple::PathRequest::mLastIndex
private

Definition at line 153 of file PathRequest.h.

◆ mInProgress

bool ripple::PathRequest::mInProgress
private

Definition at line 154 of file PathRequest.h.

◆ iLevel

int ripple::PathRequest::iLevel
private

Definition at line 156 of file PathRequest.h.

◆ bLastSuccess

bool ripple::PathRequest::bLastSuccess
private

Definition at line 157 of file PathRequest.h.

◆ iIdentifier

int ripple::PathRequest::iIdentifier
private

Definition at line 159 of file PathRequest.h.

◆ created_

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

Definition at line 161 of file PathRequest.h.

◆ quick_reply_

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

Definition at line 162 of file PathRequest.h.

◆ full_reply_

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

Definition at line 163 of file PathRequest.h.

◆ max_paths_

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

Definition at line 165 of file PathRequest.h.