20#ifndef RIPPLE_PEERFINDER_HANDOUTS_H_INCLUDED
21#define RIPPLE_PEERFINDER_HANDOUTS_H_INCLUDED
23#include <xrpld/peerfinder/detail/SlotImp.h>
24#include <xrpld/peerfinder/detail/Tuning.h>
26#include <xrpl/beast/container/aged_set.h>
27#include <xrpl/beast/utility/instrumentation.h>
41template <
class Target,
class HopContainer>
47 "ripple::PeerFinder::detail::handout_one : target is not full");
48 for (
auto it = h.begin(); it != h.end(); ++it)
66template <
class TargetFwdIter,
class SeqFwdIter>
77 for (
auto si = seq_first; si != seq_last; ++si)
81 for (
auto ti = first; ti != last; ++ti)
106 template <
class =
void>
109 template <
class =
void>
173 return other.address.address() == ep.address.address();
190 template <
class =
void>
193 template <
class =
void>
252 return other.address.address() == ep.address.address();
286 template <
class =
void>
289 template <
class =
void>
326 : m_needed(needed), m_squelches(squelches)
344 return other.address() == endpoint.address();
A version-independent IP address and port combination.
Address const & address() const
Returns the address portion of this endpoint.
Associative container where each element is also indexed by time.
auto insert(value_type const &value) -> typename std::enable_if<!maybe_multi, std::pair< iterator, bool > >::type
Receives handouts for making automatic connections.
std::vector< beast::IP::Endpoint > list_type
ConnectHandouts(std::size_t needed, Squelches &squelches)
bool try_insert(beast::IP::Endpoint const &endpoint)
bool try_insert(Endpoint const &endpoint)
list_type const & list() const
Receives handouts for redirecting a connection.
std::vector< Endpoint > list_
bool try_insert(Endpoint const &ep)
SlotImp::ptr const & slot() const
std::vector< Endpoint > & list()
RedirectHandouts(SlotImp::ptr const &slot)
std::vector< Endpoint > const & list() const
Receives endpoints for a slot during periodic handouts.
void insert(Endpoint const &ep)
SlotHandouts(SlotImp::ptr const &slot)
std::vector< Endpoint > const & list() const
std::vector< Endpoint > list_
bool try_insert(Endpoint const &ep)
SlotImp::ptr const & slot() const
std::uint32_t constexpr redirectEndpointCount
std::uint32_t constexpr numberOfEndpoints
std::uint32_t constexpr maxHops
std::size_t handout_one(Target &t, HopContainer &h)
Try to insert one object in the target.
void handout(TargetFwdIter first, TargetFwdIter last, SeqFwdIter seq_first, SeqFwdIter seq_last)
Distributes objects to targets according to business rules.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Describes a connectible peer address along with some metadata.
beast::IP::Endpoint address