20#ifndef RIPPLE_PEERFINDER_BOOTCACHE_H_INCLUDED
21#define RIPPLE_PEERFINDER_BOOTCACHE_H_INCLUDED
23#include <xrpld/peerfinder/PeerfinderManager.h>
24#include <xrpld/peerfinder/detail/Store.h>
26#include <xrpl/basics/comparators.h>
27#include <xrpl/beast/utility/Journal.h>
28#include <xrpl/beast/utility/PropertyStream.h>
30#include <boost/bimap.hpp>
31#include <boost/bimap/multiset_of.hpp>
32#include <boost/bimap/unordered_set_of.hpp>
33#include <boost/iterator/transform_iterator.hpp>
87 using left_t = boost::bimaps::unordered_set_of<
89 boost::hash<beast::IP::Endpoint>,
91 using right_t = boost::bimaps::multiset_of<Entry, ripple::less<Entry>>;
92 using map_type = boost::bimap<left_t, right_t>;
98 map_type::right_map::const_iterator::value_type
const&;
105 map_type::right_map::const_iterator::value_type
const& v)
const
128 transform_iterator<Transform, map_type::right_map::const_iterator>;
A version-independent IP address and port combination.
A generic endpoint for log messages.
typename Clock::time_point time_point
friend bool operator<(Entry const &lhs, Entry const &rhs)
Stores IP addresses useful for gaining initial connections.
map_type::size_type size() const
Returns the number of entries in the cache.
clock_type::time_point m_whenUpdate
const_iterator cbegin() const
const_iterator end() const
static constexpr int staticValence
const_iterator cend() const
void periodicActivity()
Stores the cache in the persistent database on a timer.
boost::transform_iterator< Transform, map_type::right_map::const_iterator > iterator
map_type::value_type value_type
bool insert(beast::IP::Endpoint const &endpoint)
Add a newly-learned address to the cache.
boost::bimaps::unordered_set_of< beast::IP::Endpoint, boost::hash< beast::IP::Endpoint >, ripple::equal_to< beast::IP::Endpoint > > left_t
void on_failure(beast::IP::Endpoint const &endpoint)
Called when an outbound connection attempt fails to handshake.
const_iterator begin() const
IP::Endpoint iterators that traverse in decreasing valence.
void onWrite(beast::PropertyStream::Map &map)
Write the cache state to the property stream.
void on_success(beast::IP::Endpoint const &endpoint)
Called when an outbound connection handshake completes.
bool empty() const
Returns true if the cache is empty.
bool insertStatic(beast::IP::Endpoint const &endpoint)
Add a staticallyconfigured address to the cache.
boost::bimaps::multiset_of< Entry, ripple::less< Entry > > right_t
void load()
Load the persisted data from the Store into the container.
boost::bimap< left_t, right_t > map_type
Abstract persistence for PeerFinder data.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.