3#include <xrpld/overlay/Message.h>
4#include <xrpld/overlay/Peer.h>
31template <
typename Predicate>
52template <
typename Predicate>
53send_if_pred<Predicate>
62template <
typename Predicate>
83template <
typename Predicate>
84send_if_not_pred<Predicate>
128 if (!peer->cluster())
149 if (
peerSet.count(peer->id()) == 0)
Represents a peer connection in the overlay.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
send_if_not_pred< Predicate > send_if_not(std::shared_ptr< Message > const &m, Predicate const &f)
Helper function to aid in type deduction.
send_if_pred< Predicate > send_if(std::shared_ptr< Message > const &m, Predicate const &f)
Helper function to aid in type deduction.
Select the specific peer.
match_peer(Peer const *match=nullptr)
bool operator()(std::shared_ptr< Peer > const &peer) const
Select all peers (except optional excluded) that are in our cluster.
peer_in_cluster(Peer const *skip=nullptr)
bool operator()(std::shared_ptr< Peer > const &peer) const
Select all peers that are in the specified set.
peer_in_set(std::set< Peer::id_t > const &peers)
std::set< Peer::id_t > const & peerSet
bool operator()(std::shared_ptr< Peer > const &peer) const
Sends a message to all peers.
void operator()(std::shared_ptr< Peer > const &peer) const
std::shared_ptr< Message > const & msg
send_always(std::shared_ptr< Message > const &m)
Sends a message to non-matching peers.
void operator()(std::shared_ptr< Peer > const &peer) const
Predicate const & predicate
std::shared_ptr< Message > const & msg
send_if_not_pred(std::shared_ptr< Message > const &m, Predicate const &p)
Sends a message to match peers.
void operator()(std::shared_ptr< Peer > const &peer) const
send_if_pred(std::shared_ptr< Message > const &m, Predicate const &p)
std::shared_ptr< Message > const & msg
Predicate const & predicate