llarp::util::DecayingHashSet

More...

Public Types

Name
using std::chrono::milliseconds Time_t

Public Functions

Name
DecayingHashSet(Time_t cacheInterval =1s)
size_t Size() const
bool Contains(const Val_t & v) const
determine if we have v contained in our decaying hashset
bool Insert(const Val_t & v, Time_t now =0s)
return true if inserted return false if not inserted
void Upsert(const Val_t & v)
upsert will insert or update a value with time as now
void Decay(Time_t now =0s)
decay hashset entries
Time_t DecayInterval() const
bool Empty() const
void DecayInterval(Time_t interval)
void Remove(const Val_t & val)

Detailed Description

template <typename Val_t ,
typename Hash_t  =std::hash<Val_t>>
struct llarp::util::DecayingHashSet;

Public Types Documentation

using Time_t

using llarp::util::DecayingHashSet< Val_t, Hash_t >::Time_t =  std::chrono::milliseconds;

Public Functions Documentation

function DecayingHashSet

inline DecayingHashSet(
    Time_t cacheInterval =1s
)

function Size

inline size_t Size() const

function Contains

inline bool Contains(
    const Val_t & v
) const

determine if we have v contained in our decaying hashset

function Insert

inline bool Insert(
    const Val_t & v,
    Time_t now =0s
)

return true if inserted return false if not inserted

function Upsert

inline void Upsert(
    const Val_t & v
)

upsert will insert or update a value with time as now

function Decay

inline void Decay(
    Time_t now =0s
)

decay hashset entries

function DecayInterval

inline Time_t DecayInterval() const

function Empty

inline bool Empty() const

function DecayInterval

inline void DecayInterval(
    Time_t interval
)

function Remove

inline void Remove(
    const Val_t & val
)

Updated on 2026-01-10 at 22:49:45 +0000