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