3#include <xrpl/beast/container/aged_set.h>
4#include <xrpl/beast/net/IPAddress.h>
5#include <xrpl/beast/utility/instrumentation.h>
6#include <xrpl/peerfinder/Types.h>
7#include <xrpl/peerfinder/detail/SlotImp.h>
8#include <xrpl/peerfinder/detail/Tuning.h>
27template <
class Target,
class HopContainer>
31 XRPL_ASSERT(!t.full(),
"xrpl::peer_finder::detail::handoutOne : target is not full");
32 for (
auto it = h.begin(); it != h.end(); ++it)
51template <
class TargetFwdIter,
class SeqFwdIter>
53handout(TargetFwdIter first, TargetFwdIter last, SeqFwdIter seqFirst, SeqFwdIter seqLast)
58 for (
auto si = seqFirst; si != seqLast; ++si)
62 for (
auto ti = first; ti != last; ++ti)
88 template <
class =
void>
91 template <
class =
void>
174 template <
class =
void>
177 template <
class =
void>
272 template <
class =
void>
275 template <
class =
void>
282 return list_.empty();
314 list_.reserve(needed);
339 list_.push_back(endpoint);
A version-independent IP address and port combination.
Address const & address() const
Returns the address portion of this endpoint.
beast::aged_set< beast::ip::Address > Squelches
ConnectHandouts(std::size_t needed, Squelches &squelches)
bool tryInsert(beast::ip::Endpoint const &endpoint)
list_type const & list() const
std::vector< beast::ip::Endpoint > list_type
bool tryInsert(Endpoint const &endpoint)
std::vector< Endpoint > & list()
std::vector< Endpoint > list_
RedirectHandouts(SlotImp::ptr slot)
SlotImp::ptr const & slot() const
bool tryInsert(Endpoint const &ep)
std::vector< Endpoint > const & list() const
SlotHandouts(SlotImp::ptr slot)
std::vector< Endpoint > list_
std::vector< Endpoint > const & list() const
bool tryInsert(Endpoint const &ep)
SlotImp::ptr const & slot() const
void insert(Endpoint const &ep)
std::shared_ptr< SlotImp > ptr
detail::AgedOrderedContainer< false, false, Key, void, Clock, Compare, Allocator > aged_set
std::size_t handoutOne(Target &t, HopContainer &h)
Try to insert one object in the target.
constexpr std::uint32_t kRedirectEndpointCount
constexpr std::uint32_t kNumberOfEndpoints
constexpr std::uint32_t kMaxHops
void handout(TargetFwdIter first, TargetFwdIter last, SeqFwdIter seqFirst, SeqFwdIter seqLast)
Distributes objects to targets according to business rules.
Describes a connectable peer address along with some metadata.
beast::ip::Endpoint address