20 #ifndef RIPPLE_BASICS_COUNTEDOBJECT_H_INCLUDED
21 #define RIPPLE_BASICS_COUNTEDOBJECT_H_INCLUDED
23 #include <ripple/beast/type_name.h>
60 head = instance.
m_head.load();
62 }
while (instance.
m_head.exchange(
this) != head);
123 template <class Object>
137 getCounter().increment();
142 getCounter().increment();
150 getCounter().decrement();
Counter(std::string name) noexcept
std::string const & getName() const noexcept
Counter * getNext() const noexcept
std::atomic< int > m_count
Tracks the number of instances of an object.
std::atomic< Counter * > m_head
~CountedObject() noexcept
CountedObjects() noexcept
int getCount() const noexcept
static CountedObjects & getInstance() noexcept
static auto & getCounter() noexcept
~Counter() noexcept=default
Implementation for CountedObject.
CountedObject(CountedObject const &) noexcept
Manages all counted object types.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
List getCounts(int minimumThreshold) const
std::atomic< int > count_