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