folly::SingletonRelaxedCountable

A CRTP base class that keeps a global count of instances of a type.

Synopsis

Declared in <folly/concurrency/SingletonRelaxedCounter.h>

template<typename Counted>
class SingletonRelaxedCountable;

Description

The running count is maintained with a relaxed SingletonRelaxedCounter. To avoid adding names to the counted type, the count is read through the separate type SingletonRelaxedCountableAccess.

Member Functions

NameDescription
SingletonRelaxedCountable [constructor]Constructors
~SingletonRelaxedCountable [destructor]Destroys the base and decrements the instance count.
operator= Assignment operators

Friends

NameDescription
folly::SingletonRelaxedCountableAccessProvides access to the running instance count of a countable type.

Template Parameters

NameDescription
CountedThe derived type being counted.