rippled
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
ripple::TransactionAcquire Class Referencefinal
Inheritance diagram for ripple::TransactionAcquire:
Inheritance graph
[legend]
Collaboration diagram for ripple::TransactionAcquire:
Collaboration graph
[legend]

Public Types

using pointer = std::shared_ptr< TransactionAcquire >
 

Public Member Functions

 TransactionAcquire (Application &app, uint256 const &hash)
 
 ~TransactionAcquire ()=default
 
SHAMapAddNode takeNodes (const std::list< SHAMapNodeID > &IDs, const std::list< Blob > &data, std::shared_ptr< Peer > const &)
 
void init (int startPeers)
 
void stillNeed ()
 
shared_from_this (T... args)
 
weak_from_this (T... args)
 

Protected Types

using ScopedLockType = std::unique_lock< std::recursive_mutex >
 

Protected Member Functions

void addPeers (std::size_t limit, std::function< bool(std::shared_ptr< Peer > const &)> score)
 Add at most limit peers to this set from the overlay. More...
 
bool isDone () const
 
void invokeOnTimer ()
 Calls onTimer() if in the right state. More...
 
void sendRequest (const protocol::TMGetLedger &message, std::shared_ptr< Peer > const &peer)
 Send a GetLedger message to one or all peers. More...
 
void setTimer ()
 Schedule a call to queueJob() after mTimerInterval. More...
 

Protected Attributes

Applicationapp_
 
beast::Journal m_journal
 
std::recursive_mutex mLock
 
const uint256 mHash
 The hash of the object (in practice, always a ledger) we are trying to fetch. More...
 
int mTimeouts
 
bool mComplete
 
bool mFailed
 
bool mProgress
 Whether forward progress has been made. More...
 
std::set< Peer::id_tmPeers
 The identifiers of the peers we are tracking. More...
 

Private Member Functions

void queueJob () override
 Queue a job to call invokeOnTimer(). More...
 
void onTimer (bool progress, ScopedLockType &peerSetLock) override
 Hook called from invokeOnTimer(). More...
 
void onPeerAdded (std::shared_ptr< Peer > const &peer) override
 Hook called from addPeers(). More...
 
void done ()
 
void addPeers (std::size_t limit)
 
void trigger (std::shared_ptr< Peer > const &)
 
std::weak_ptr< PeerSetpmDowncast () override
 Return a weak pointer to this. More...
 

Static Private Member Functions

static auto & getCounter () noexcept
 

Private Attributes

std::shared_ptr< SHAMapmMap
 
bool mHaveRoot
 
std::chrono::milliseconds mTimerInterval
 The minimum time to wait between calls to execute(). More...
 
boost::asio::basic_waitable_timer< std::chrono::steady_clockmTimer
 

Detailed Description

Definition at line 31 of file TransactionAcquire.h.

Member Typedef Documentation

◆ pointer

Definition at line 37 of file TransactionAcquire.h.

◆ ScopedLockType

Definition at line 51 of file PeerSet.h.

Constructor & Destructor Documentation

◆ TransactionAcquire()

ripple::TransactionAcquire::TransactionAcquire ( Application app,
uint256 const &  hash 
)

Definition at line 42 of file TransactionAcquire.cpp.

◆ ~TransactionAcquire()

ripple::TransactionAcquire::~TransactionAcquire ( )
default

Member Function Documentation

◆ takeNodes()

SHAMapAddNode ripple::TransactionAcquire::takeNodes ( const std::list< SHAMapNodeID > &  IDs,
const std::list< Blob > &  data,
std::shared_ptr< Peer > const &  peer 
)

Definition at line 177 of file TransactionAcquire.cpp.

◆ init()

void ripple::TransactionAcquire::init ( int  startPeers)

Definition at line 253 of file TransactionAcquire.cpp.

◆ stillNeed()

void ripple::TransactionAcquire::stillNeed ( )

Definition at line 263 of file TransactionAcquire.cpp.

◆ queueJob()

void ripple::TransactionAcquire::queueJob ( )
overrideprivatevirtual

Queue a job to call invokeOnTimer().

Implements ripple::PeerSet.

Definition at line 52 of file TransactionAcquire.cpp.

◆ onTimer()

void ripple::TransactionAcquire::onTimer ( bool  progress,
ScopedLockType  
)
overrideprivatevirtual

Hook called from invokeOnTimer().

Implements ripple::PeerSet.

Definition at line 90 of file TransactionAcquire.cpp.

◆ onPeerAdded()

void ripple::TransactionAcquire::onPeerAdded ( std::shared_ptr< Peer > const &  )
overrideprivatevirtual

Hook called from addPeers().

Implements ripple::PeerSet.

Definition at line 65 of file TransactionAcquire.h.

◆ done()

void ripple::TransactionAcquire::done ( )
private

Definition at line 61 of file TransactionAcquire.cpp.

◆ addPeers() [1/2]

void ripple::TransactionAcquire::addPeers ( std::size_t  limit)
private

Definition at line 246 of file TransactionAcquire.cpp.

◆ trigger()

void ripple::TransactionAcquire::trigger ( std::shared_ptr< Peer > const &  peer)
private

Definition at line 112 of file TransactionAcquire.cpp.

◆ pmDowncast()

std::weak_ptr< PeerSet > ripple::TransactionAcquire::pmDowncast ( )
overrideprivatevirtual

Return a weak pointer to this.

Implements ripple::PeerSet.

Definition at line 106 of file TransactionAcquire.cpp.

◆ addPeers() [2/2]

void ripple::PeerSet::addPeers ( std::size_t  limit,
std::function< bool(std::shared_ptr< Peer > const &)>  score 
)
protectedinherited

Add at most limit peers to this set from the overlay.

Definition at line 50 of file PeerSet.cpp.

◆ isDone()

bool ripple::PeerSet::isDone ( ) const
protectedinherited

Definition at line 84 of file PeerSet.h.

◆ invokeOnTimer()

void ripple::PeerSet::invokeOnTimer ( )
protectedinherited

Calls onTimer() if in the right state.

Definition at line 101 of file PeerSet.cpp.

◆ sendRequest()

void ripple::PeerSet::sendRequest ( const protocol::TMGetLedger &  message,
std::shared_ptr< Peer > const &  peer 
)
protectedinherited

Send a GetLedger message to one or all peers.

Definition at line 127 of file PeerSet.cpp.

◆ setTimer()

void ripple::PeerSet::setTimer ( )
protectedinherited

Schedule a call to queueJob() after mTimerInterval.

Definition at line 87 of file PeerSet.cpp.

◆ getCounter()

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

Definition at line 128 of file CountedObject.h.

Member Data Documentation

◆ mMap

std::shared_ptr<SHAMap> ripple::TransactionAcquire::mMap
private

Definition at line 55 of file TransactionAcquire.h.

◆ mHaveRoot

bool ripple::TransactionAcquire::mHaveRoot
private

Definition at line 56 of file TransactionAcquire.h.

◆ app_

Application& ripple::PeerSet::app_
protectedinherited

Definition at line 105 of file PeerSet.h.

◆ m_journal

beast::Journal ripple::PeerSet::m_journal
protectedinherited

Definition at line 106 of file PeerSet.h.

◆ mLock

std::recursive_mutex ripple::PeerSet::mLock
protectedinherited

Definition at line 108 of file PeerSet.h.

◆ mHash

const uint256 ripple::PeerSet::mHash
protectedinherited

The hash of the object (in practice, always a ledger) we are trying to fetch.

Definition at line 112 of file PeerSet.h.

◆ mTimeouts

int ripple::PeerSet::mTimeouts
protectedinherited

Definition at line 113 of file PeerSet.h.

◆ mComplete

bool ripple::PeerSet::mComplete
protectedinherited

Definition at line 114 of file PeerSet.h.

◆ mFailed

bool ripple::PeerSet::mFailed
protectedinherited

Definition at line 115 of file PeerSet.h.

◆ mProgress

bool ripple::PeerSet::mProgress
protectedinherited

Whether forward progress has been made.

Definition at line 117 of file PeerSet.h.

◆ mPeers

std::set<Peer::id_t> ripple::PeerSet::mPeers
protectedinherited

The identifiers of the peers we are tracking.

Definition at line 120 of file PeerSet.h.

◆ mTimerInterval

std::chrono::milliseconds ripple::PeerSet::mTimerInterval
privateinherited

The minimum time to wait between calls to execute().

Definition at line 124 of file PeerSet.h.

◆ mTimer

boost::asio::basic_waitable_timer<std::chrono::steady_clock> ripple::PeerSet::mTimer
privateinherited

Definition at line 126 of file PeerSet.h.