20 #ifndef RIPPLE_OVERLAY_PREDICATES_H_INCLUDED
21 #define RIPPLE_OVERLAY_PREDICATES_H_INCLUDED
23 #include <ripple/overlay/Message.h>
24 #include <ripple/overlay/Peer.h>
50 template <
typename Predicate>
70 template <
typename Predicate>
81 template <
typename Predicate>
101 template <
typename Predicate>
145 if (! peer->cluster())
165 if (
peerSet.count (peer->id ()) == 0)
peer_in_cluster(Peer const *skip=nullptr)
bool operator()(std::shared_ptr< Peer > const &peer) const
send_if_not_pred(std::shared_ptr< Message > const &m, Predicate const &p)
Predicate const & predicate
std::set< Peer::id_t > const & peerSet
Predicate const & predicate
bool operator()(std::shared_ptr< Peer > const &peer) const
void operator()(std::shared_ptr< Peer > const &peer) const
Sends a message to match peers.
Sends a message to non-matching peers.
Select the specific peer.
std::shared_ptr< Message > const & msg
Select all peers that are in the specified set.
void operator()(std::shared_ptr< Peer > const &peer) const
Sends a message to all peers.
send_if_pred(std::shared_ptr< Message > const &m, Predicate const &p)
Select all peers (except optional excluded) that are in our cluster.
send_always(std::shared_ptr< Message > const &m)
std::shared_ptr< Message > const & msg
void operator()(std::shared_ptr< Peer > const &peer) const
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.
peer_in_set(std::set< Peer::id_t > const &peers)
match_peer(Peer const *match=nullptr)
send_if_pred< Predicate > send_if(std::shared_ptr< Message > const &m, Predicate const &f)
Helper function to aid in type deduction.
bool operator()(std::shared_ptr< Peer > const &peer) const
std::shared_ptr< Message > const & msg
Represents a peer connection in the overlay.