rippled
Loading...
Searching...
No Matches
Fixed.h
1#pragma once
2
3#include <xrpld/peerfinder/detail/Tuning.h>
4
5namespace xrpl {
6namespace PeerFinder {
7
9class Fixed
10{
11public:
12 explicit Fixed(clock_type& clock) : m_when(clock.now()), m_failures(0)
13 {
14 }
15
16 Fixed(Fixed const&) = default;
17
20 when() const
21 {
22 return m_when;
23 }
24
26 void
32
34 void
36 {
37 m_failures = 0;
38 m_when = now;
39 }
40
41private:
44};
45
46} // namespace PeerFinder
47} // namespace xrpl
Metadata for a Fixed slot.
Definition Fixed.h:10
std::size_t m_failures
Definition Fixed.h:43
clock_type::time_point const & when() const
Returns the time after which we should allow a connection attempt.
Definition Fixed.h:20
void failure(clock_type::time_point const &now)
Updates metadata to reflect a failed connection.
Definition Fixed.h:27
clock_type::time_point m_when
Definition Fixed.h:42
Fixed(clock_type &clock)
Definition Fixed.h:12
void success(clock_type::time_point const &now)
Updates metadata to reflect a successful connection.
Definition Fixed.h:35
Fixed(Fixed const &)=default
T min(T... args)
static std::array< int, 10 > const connectionBackoff
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5