rippled
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
xrpl::RippleLineCache Class Referencefinal

#include <RippleLineCache.h>

Inheritance diagram for xrpl::RippleLineCache:
Inheritance graph
[legend]
Collaboration diagram for xrpl::RippleLineCache:
Collaboration graph
[legend]

Classes

struct  AccountKey
 

Public Member Functions

 RippleLineCache (std::shared_ptr< ReadView const > const &l, beast::Journal j)
 
 ~RippleLineCache ()
 
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.
 

Static Private Member Functions

static auto & getCounter () noexcept
 

Private Attributes

std::mutex mLock
 
xrpl::hardened_hash 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
 

Detailed Description

Definition at line 17 of file RippleLineCache.h.

Constructor & Destructor Documentation

◆ RippleLineCache()

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

Definition at line 6 of file RippleLineCache.cpp.

◆ ~RippleLineCache()

xrpl::RippleLineCache::~RippleLineCache ( )

Definition at line 14 of file RippleLineCache.cpp.

Member Function Documentation

◆ getLedger()

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

Definition at line 26 of file RippleLineCache.h.

◆ getRippleLines()

std::shared_ptr< std::vector< PathFindTrustLine > > xrpl::RippleLineCache::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 22 of file RippleLineCache.cpp.

◆ getCounter()

static auto & xrpl::CountedObject< RippleLineCache >::getCounter ( )
staticprivatenoexceptinherited

Definition at line 110 of file CountedObject.h.

Member Data Documentation

◆ mLock

std::mutex xrpl::RippleLineCache::mLock
private

Definition at line 47 of file RippleLineCache.h.

◆ hasher_

xrpl::hardened_hash xrpl::RippleLineCache::hasher_
private

Definition at line 49 of file RippleLineCache.h.

◆ ledger_

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

Definition at line 50 of file RippleLineCache.h.

◆ journal_

beast::Journal xrpl::RippleLineCache::journal_
private

Definition at line 52 of file RippleLineCache.h.

◆ lines_

hash_map< AccountKey, std::shared_ptr<std::vector<PathFindTrustLine> >, AccountKey::Hash> xrpl::RippleLineCache::lines_
private

Definition at line 107 of file RippleLineCache.h.

◆ totalLineCount_

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

Definition at line 108 of file RippleLineCache.h.