Kanzi  3.9.4
Kanzi Engine API
kanzi::ScopedRefCounter Class Reference

Scoped reference counter, which takes an unsigned integer value as argument on construction to track. More...

#include <kanzi/core/util/scoped_ref_counter.hpp>

Public Member Functions

size_t count () const
 Returns the reference counter tracked. More...
 
 ScopedRefCounter (size_t &counter)
 Constructs the reference counter and increments its value. More...
 
 ~ScopedRefCounter ()
 Destroys the reference counter and decrements the tracked counter. More...
 

Detailed Description

Scoped reference counter, which takes an unsigned integer value as argument on construction to track.

Use the class to guard incremental calls on an object.

Constructor & Destructor Documentation

◆ ScopedRefCounter()

kanzi::ScopedRefCounter::ScopedRefCounter ( size_t &  counter)
inlineexplicit

Constructs the reference counter and increments its value.

Parameters
counterReference to the counter to track.

◆ ~ScopedRefCounter()

kanzi::ScopedRefCounter::~ScopedRefCounter ( )
inline

Destroys the reference counter and decrements the tracked counter.

Member Function Documentation

◆ count()

size_t kanzi::ScopedRefCounter::count ( ) const
inline

Returns the reference counter tracked.


The documentation for this class was generated from the following file: