ardour
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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

volatile gint m_value
 

Detailed Description

Definition at line 27 of file atomic_counter.h.

Constructor & Destructor Documentation

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

Prevent copying and assignment

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

Definition at line 37 of file atomic_counter.h.

Member Function Documentation

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

convenience method,

See also
compare_and_exchange

Definition at line 85 of file atomic_counter.h.

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

Definition at line 72 of file atomic_counter.h.

bool PBD::atomic_counter::decrement_and_test ( )
inline

Definition at line 62 of file atomic_counter.h.

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

Definition at line 42 of file atomic_counter.h.

void PBD::atomic_counter::increment ( )
inline

Definition at line 52 of file atomic_counter.h.

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

Definition at line 57 of file atomic_counter.h.

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

Definition at line 67 of file atomic_counter.h.

atomic_counter& PBD::atomic_counter::operator= ( const atomic_counter )
private
void PBD::atomic_counter::set ( gint  new_value)
inline

Definition at line 47 of file atomic_counter.h.

Member Data Documentation

volatile gint PBD::atomic_counter::m_value
mutableprivate

Definition at line 93 of file atomic_counter.h.


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