1#ifndef XRPL_PEERFINDER_HANDOUTS_H_INCLUDED
2#define XRPL_PEERFINDER_HANDOUTS_H_INCLUDED
4#include <xrpld/peerfinder/detail/SlotImp.h>
5#include <xrpld/peerfinder/detail/Tuning.h>
7#include <xrpl/beast/container/aged_set.h>
8#include <xrpl/beast/utility/instrumentation.h>
22template <
class Target,
class HopContainer>
28 "ripple::PeerFinder::detail::handout_one : target is not full");
29 for (
auto it = h.begin(); it != h.end(); ++it)
47template <
class TargetFwdIter,
class SeqFwdIter>
58 for (
auto si = seq_first; si != seq_last; ++si)
62 for (
auto ti = first; ti != last; ++ti)
87 template <
class =
void>
90 template <
class =
void>
154 return other.address.address() == ep.address.address();
171 template <
class =
void>
174 template <
class =
void>
233 return other.address.address() == ep.address.address();
267 template <
class =
void>
270 template <
class =
void>
307 : m_needed(needed), m_squelches(squelches)
325 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