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

#include <AssetCache.h>

Inheritance diagram for xrpl::AssetCache:
Collaboration diagram for xrpl::AssetCache:

Classes

struct  AccountKey

Public Member Functions

 AssetCache (std::shared_ptr< ReadView const > l, beast::Journal j)
 ~AssetCache ()
std::shared_ptr< ReadView const > const & getLedger () const
std::shared_ptr< std::vector< PathFindTrustLine > > getRippleLines (AccountID const &accountID, LineDirection direction)
 Find the trust lines associated with an account.
std::shared_ptr< std::vector< PathFindMPT > > const & getMPTs (AccountID const &account)

Public Attributes

friend Object

Static Private Member Functions

static auto & getCounter () noexcept

Private Attributes

std::mutex lock_
xrpl::HardenedHash hasher_
std::shared_ptr< ReadView const > ledger_
beast::Journal journal_
hash_map< AccountKey, std::shared_ptr< std::vector< PathFindTrustLine > >, AccountKey::Hashlines_
std::size_t totalLineCount_ = 0
hash_map< AccountID, std::shared_ptr< std::vector< PathFindMPT > > > mpts_

Detailed Description

Definition at line 17 of file AssetCache.h.

Constructor & Destructor Documentation

◆ AssetCache()

xrpl::AssetCache::AssetCache ( std::shared_ptr< ReadView const > l,
beast::Journal j )
explicit

Definition at line 25 of file AssetCache.cpp.

◆ ~AssetCache()

xrpl::AssetCache::~AssetCache ( )

Definition at line 31 of file AssetCache.cpp.

Member Function Documentation

◆ getLedger()

std::shared_ptr< ReadView const > const & xrpl::AssetCache::getLedger ( ) const
nodiscard

Definition at line 24 of file AssetCache.h.

◆ getRippleLines()

std::shared_ptr< std::vector< PathFindTrustLine > > xrpl::AssetCache::getRippleLines ( AccountID const & accountID,
LineDirection direction )

Find the trust lines associated with an account.

Parameters
accountIDThe account
directionWhether the account is an "outgoing" link on the path. "Outgoing" is defined as the source account, or an account found via a trustline that has rippling enabled on the @accountID's side. If an account is "outgoing", all trust lines will be returned. If an account is not "outgoing", then any trust lines that don't have rippling enabled are not usable, so only return trust lines that have rippling enabled on @accountID's side.
Returns
Returns a vector of the usable trust lines.

Definition at line 39 of file AssetCache.cpp.

◆ getMPTs()

std::shared_ptr< std::vector< PathFindMPT > > const & xrpl::AssetCache::getMPTs ( xrpl::AccountID const & account)

Definition at line 118 of file AssetCache.cpp.

◆ getCounter()

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

Definition at line 109 of file CountedObject.h.

Member Data Documentation

◆ lock_

std::mutex xrpl::AssetCache::lock_
private

Definition at line 48 of file AssetCache.h.

◆ hasher_

xrpl::HardenedHash xrpl::AssetCache::hasher_
private

Definition at line 50 of file AssetCache.h.

◆ ledger_

std::shared_ptr<ReadView const> xrpl::AssetCache::ledger_
private

Definition at line 51 of file AssetCache.h.

◆ journal_

beast::Journal xrpl::AssetCache::journal_
private

Definition at line 53 of file AssetCache.h.

◆ lines_

Definition at line 101 of file AssetCache.h.

◆ totalLineCount_

std::size_t xrpl::AssetCache::totalLineCount_ = 0
private

Definition at line 102 of file AssetCache.h.

◆ mpts_

hash_map<AccountID, std::shared_ptr<std::vector<PathFindMPT> > > xrpl::AssetCache::mpts_
private

Definition at line 103 of file AssetCache.h.

◆ Object

Definition at line 134 of file CountedObject.h.