3#include <xrpl/beast/net/IPEndpoint.h>
4#include <xrpl/beast/utility/Journal.h>
5#include <xrpl/beast/utility/PropertyStream.h>
6#include <xrpl/peerfinder/Types.h>
7#include <xrpl/peerfinder/detail/Store.h>
8#include <xrpl/peerfinder/detail/Tuning.h>
10#include <boost/bimap.hpp>
11#include <boost/bimap/multiset_of.hpp>
12#include <boost/bimap/unordered_set_of.hpp>
13#include <boost/iterator/transform_iterator.hpp>
68 unordered_set_of<beast::ip::Endpoint, boost::hash<beast::ip::Endpoint>,
std::equal_to<>>;
69 using right_t = boost::bimaps::multiset_of<Entry, std::less<>>;
70 using map_type = boost::bimap<left_t, right_t>;
81 operator()(map_type::right_map::const_iterator::value_type
const& v)
const
103 using iterator = boost::transform_iterator<Transform, map_type::right_map::const_iterator>;
120 [[nodiscard]] map_type::size_type
std::chrono::steady_clock::time_point time_point
A generic endpoint for log messages.
A version-independent IP address and port combination.
friend bool operator<(Entry const &lhs, Entry const &rhs)
static constexpr int kStaticValence
bool insertStatic(beast::ip::Endpoint const &endpoint)
Add a staticallyconfigured address to the cache.
void onWrite(beast::PropertyStream::Map &map)
Write the cache state to the property stream.
map_type::value_type value_type
void load()
Load the persisted data from the Store into the container.
const_iterator begin() const
ip::Endpoint iterators that traverse in decreasing valence.
bool insert(beast::ip::Endpoint const &endpoint)
Add a newly-learned address to the cache.
bool empty() const
Returns true if the cache is empty.
boost::transform_iterator< Transform, map_type::right_map::const_iterator > iterator
boost::bimaps::multiset_of< Entry, std::less<> > right_t
boost::bimap< left_t, right_t > map_type
clock_type::time_point whenUpdate_
const_iterator end() const
map_type::size_type size() const
Returns the number of entries in the cache.
void onFailure(beast::ip::Endpoint const &endpoint)
Called when an outbound connection attempt fails to handshake.
const_iterator cend() const
void onSuccess(beast::ip::Endpoint const &endpoint)
Called when an outbound connection handshake completes.
void periodicActivity()
Stores the cache in the persistent database on a timer.
const_iterator cbegin() const
Bootcache(Store &store, clock_type &clock, beast::Journal journal)
boost::bimaps:: unordered_set_of< beast::ip::Endpoint, boost::hash< beast::ip::Endpoint >, std::equal_to<> > left_t
Abstract persistence for PeerFinder data.
beast::AbstractClock< std::chrono::steady_clock > clock_type