rippled
Classes | Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
ripple::RippleLineCache Class Referencefinal
Inheritance diagram for ripple::RippleLineCache:
Inheritance graph
[legend]
Collaboration diagram for ripple::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. More...
 

Static Private Member Functions

static auto & getCounter () noexcept
 

Private Attributes

std::mutex mLock
 
ripple::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 36 of file RippleLineCache.h.

Constructor & Destructor Documentation

◆ RippleLineCache()

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

Definition at line 26 of file RippleLineCache.cpp.

◆ ~RippleLineCache()

ripple::RippleLineCache::~RippleLineCache ( )

Definition at line 34 of file RippleLineCache.cpp.

Member Function Documentation

◆ getLedger()

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

Definition at line 45 of file RippleLineCache.h.

◆ getRippleLines()

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

◆ getCounter()

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

Definition at line 128 of file CountedObject.h.

Member Data Documentation

◆ mLock

std::mutex ripple::RippleLineCache::mLock
private

Definition at line 66 of file RippleLineCache.h.

◆ hasher_

ripple::hardened_hash ripple::RippleLineCache::hasher_
private

Definition at line 68 of file RippleLineCache.h.

◆ ledger_

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

Definition at line 69 of file RippleLineCache.h.

◆ journal_

beast::Journal ripple::RippleLineCache::journal_
private

Definition at line 71 of file RippleLineCache.h.

◆ lines_

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

Definition at line 126 of file RippleLineCache.h.

◆ totalLineCount_

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

Definition at line 127 of file RippleLineCache.h.