20 #ifndef RIPPLE_APP_PEERS_PEERSET_H_INCLUDED
21 #define RIPPLE_APP_PEERS_PEERSET_H_INCLUDED
23 #include <ripple/app/main/Application.h>
24 #include <ripple/beast/clock/abstract_clock.h>
25 #include <ripple/beast/utility/Journal.h>
26 #include <ripple/overlay/Peer.h>
27 #include <boost/asio/basic_waitable_timer.hpp>
144 void sendRequest (
const protocol::TMGetLedger& message);
168 boost::asio::basic_waitable_timer<std::chrono::steady_clock>
mTimer;
virtual void onTimer(bool progress, ScopedLockType &)=0
std::size_t getPeerCount() const
clock_type::time_point getLastAction() const
boost::asio::basic_waitable_timer< std::chrono::steady_clock > mTimer
std::set< Peer::id_t > mPeers
virtual bool isDone() const
virtual void newPeer(std::shared_ptr< Peer > const &)=0
bool insert(std::shared_ptr< Peer > const &)
Insert a peer to the managed set.
virtual time_point now() const =0
Returns the current time.
A generic endpoint for log messages.
PeerSet(Application &app, uint256 const &hash, std::chrono::milliseconds interval, clock_type &clock, beast::Journal journal)
void sendRequest(const protocol::TMGetLedger &message)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
int getTimeouts() const
Returns the number of times we timed out.
Supports data retrieval by managing a set of peers.
std::chrono::milliseconds mTimerInterval
clock_type::time_point mLastAction
uint256 const & getHash() const
Returns the hash of the data we want.
bool isComplete() const
Returns true if we got all the data.
bool isFailed() const
Returns false if we failed to get the data.
virtual std::weak_ptr< PeerSet > pmDowncast()=0
typename std::chrono::steady_clock ::time_point time_point
void progress()
Called to indicate that forward progress has been made.
std::recursive_mutex mLock