20 #ifndef RIPPLE_PEERFINDER_HANDOUTS_H_INCLUDED
21 #define RIPPLE_PEERFINDER_HANDOUTS_H_INCLUDED
23 #include <ripple/beast/container/aged_set.h>
24 #include <ripple/peerfinder/impl/SlotImp.h>
25 #include <ripple/peerfinder/impl/Tuning.h>
31 namespace PeerFinder {
42 template <
class Target,
class HopContainer>
47 for (
auto it = h.begin(); it != h.end(); ++it)
65 template <
class TargetFwdIter,
class SeqFwdIter>
76 for (
auto si = seq_first; si != seq_last; ++si)
80 for (
auto ti = first; ti != last; ++ti)
105 template <
class =
void>
108 template <
class =
void>
172 return other.address.address() == ep.address.address();
189 template <
class =
void>
192 template <
class =
void>
251 return other.address.address() == ep.address.address();
285 template <
class =
void>
288 template <
class =
void>
325 : m_needed(needed), m_squelches(squelches)
343 return other.address() == endpoint.address();
bool try_insert(Endpoint const &ep)
Receives endpoints for a slot during periodic handouts.
constexpr std::uint32_t redirectEndpointCount
ConnectHandouts(std::size_t needed, Squelches &squelches)
Receives handouts for making automatic connections.
Receives handouts for redirecting a connection.
Address const & address() const
Returns the address portion of this endpoint.
auto insert(value_type const &value) -> typename std::enable_if<!maybe_multi, std::pair< iterator, bool >>::type
SlotImp::ptr const & slot() const
RedirectHandouts(SlotImp::ptr const &slot)
std::vector< Endpoint > const & list() const
std::vector< beast::IP::Endpoint > list_type
std::vector< Endpoint > const & list() const
std::size_t handout_one(Target &t, HopContainer &h)
Try to insert one object in the target.
bool try_insert(Endpoint const &endpoint)
std::vector< Endpoint > & list()
bool try_insert(Endpoint const &ep)
std::vector< Endpoint > list_
SlotHandouts(SlotImp::ptr const &slot)
void handout(TargetFwdIter first, TargetFwdIter last, SeqFwdIter seq_first, SeqFwdIter seq_last)
Distributes objects to targets according to business rules.
T emplace_back(T... args)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Associative container where each element is also indexed by time.
bool try_insert(beast::IP::Endpoint const &endpoint)
SlotImp::ptr const & slot() const
list_type const & list() const
A version-independent IP address and port combination.
std::vector< Endpoint > list_
constexpr std::uint32_t maxHops
Describes a connectible peer address along with some metadata.
constexpr std::uint32_t numberOfEndpoints
beast::IP::Endpoint address
void insert(Endpoint const &ep)