llarp::dht::Bucket
More...
Public Classes
Public Types
Public Functions
Public Attributes
Detailed Description
template <typename Val_t >
struct llarp::dht::Bucket;
Public Types Documentation
using BucketStorage_t
using llarp::dht::Bucket< Val_t >::BucketStorage_t = std::map<Key_t, Val_t, XorMetric>;
using Random_t
using llarp::dht::Bucket< Val_t >::Random_t = std::function<uint64_t()>;
Public Functions Documentation
function Bucket
inline Bucket(
const Key_t & us,
Random_t r
)
function size
inline size_t size() const
function GetRandomNodeExcluding
inline bool GetRandomNodeExcluding(
Key_t & result,
const std::set< Key_t > & exclude
) const
function FindClosest
inline bool FindClosest(
const Key_t & target,
Key_t & result
) const
function GetManyRandom
inline bool GetManyRandom(
std::set< Key_t > & result,
size_t N
) const
function FindCloseExcluding
inline bool FindCloseExcluding(
const Key_t & target,
Key_t & result,
const std::set< Key_t > & exclude
) const
function GetManyNearExcluding
inline bool GetManyNearExcluding(
const Key_t & target,
std::set< Key_t > & result,
size_t N,
const std::set< Key_t > & exclude
) const
function PutNode
inline void PutNode(
const Val_t & val
)
function DelNode
inline void DelNode(
const Key_t & key
)
function HasNode
inline bool HasNode(
const Key_t & key
) const
function RemoveIf
template <typename Predicate >
inline void RemoveIf(
Predicate pred
)
function ForEachNode
template <typename Visit_t >
inline void ForEachNode(
Visit_t visit
)
function Clear
inline void Clear()
Public Attributes Documentation
variable nodes
BucketStorage_t nodes;
variable random
Random_t random;
Updated on 2026-01-10 at 22:49:45 +0000