mcrl2::utilities::shared_reference_counted

Include file:

#include "mcrl2/utilities/shared_reference.h
class mcrl2::utilities::shared_reference_counted

Stores a reference count that can be incremented and decremented.

The template variable is such that reference_count_changes corresponds to the amount of times the reference count of type T changed.

Protected types

type mcrl2::utilities::shared_reference_counted::SizeType

typedef for typename std::conditional< ThreadSafe, std::atomic< std::size_t >, std::size_t >::type

Protected attributes

SizeType mcrl2::utilities::shared_reference_counted::m_reference_count

Public member functions

void decrement_reference_count() const

Decrement the reference count by one.

void increment_reference_count() const

Increment the reference count by one.

std::size_t reference_count() const

Obtain the reference count.

shared_reference_counted()

Public static member functions

static void increment_reference_count_changes()

Increment the number of reference count changes.

static std::size_t &reference_count_changes()

Obtain the number of times that this reference count has changed.