Ardour  9.0-pre0-582-g084a23a80d
PBD::atomic_counter Class Reference

#include <atomic_counter.h>

Public Member Functions

 atomic_counter (gint value=0)
 
gint get () const
 
void set (gint new_value)
 
void increment ()
 
void operator++ ()
 
bool decrement_and_test ()
 
bool operator-- ()
 
bool compare_and_exchange (gint old_value, gint new_value)
 
bool cas (gint old_value, gint new_value)
 

Private Member Functions

 atomic_counter (const atomic_counter &)
 
atomic_counteroperator= (const atomic_counter &)
 

Private Attributes

std::atomic< int > m_value
 

Detailed Description

Definition at line 31 of file atomic_counter.h.

Constructor & Destructor Documentation

◆ atomic_counter() [1/2]

PBD::atomic_counter::atomic_counter ( const atomic_counter )
private

Prevent copying and assignment

◆ atomic_counter() [2/2]

PBD::atomic_counter::atomic_counter ( gint  value = 0)
inline

Definition at line 41 of file atomic_counter.h.

Member Function Documentation

◆ cas()

bool PBD::atomic_counter::cas ( gint  old_value,
gint  new_value 
)
inline

convenience method,

See also
compare_and_exchange

Definition at line 84 of file atomic_counter.h.

◆ compare_and_exchange()

bool PBD::atomic_counter::compare_and_exchange ( gint  old_value,
gint  new_value 
)
inline

Definition at line 76 of file atomic_counter.h.

◆ decrement_and_test()

bool PBD::atomic_counter::decrement_and_test ( )
inline

Definition at line 66 of file atomic_counter.h.

◆ get()

gint PBD::atomic_counter::get ( ) const
inline

Definition at line 46 of file atomic_counter.h.

◆ increment()

void PBD::atomic_counter::increment ( )
inline

Definition at line 56 of file atomic_counter.h.

◆ operator++()

void PBD::atomic_counter::operator++ ( )
inline

Definition at line 61 of file atomic_counter.h.

◆ operator--()

bool PBD::atomic_counter::operator-- ( )
inline

Definition at line 71 of file atomic_counter.h.

◆ operator=()

atomic_counter& PBD::atomic_counter::operator= ( const atomic_counter )
private

◆ set()

void PBD::atomic_counter::set ( gint  new_value)
inline

Definition at line 51 of file atomic_counter.h.

Member Data Documentation

◆ m_value

std::atomic<int> PBD::atomic_counter::m_value
mutableprivate

Definition at line 90 of file atomic_counter.h.


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