Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

rutz::mutex_atomic_int Class Reference

#include <rutz/atomic_mutex.h>

List of all members.


Detailed Description

Heavyweight atomic integer implementation using mutexes.

Definition at line 43 of file atomic_mutex.h.

Public Member Functions

 mutex_atomic_int ()
 Construct with an initial value of 0.
int atomic_get () const
 Get the current value.
void atomic_set (int v)
 Set value to the given value v.
void atomic_add (int i)
 Add v to the value.
void atomic_sub (int i)
 Subtract v from the value.
bool atomic_sub_test_zero (int i)
 Subtract v from the value; return true if the new value is zero.
void atomic_incr ()
 Increment the value by one.
void atomic_decr ()
 Decrement the value by one.
bool atomic_decr_test_zero ()
 Decrement the value by one; return true if the new value is zero.
bool atomic_incr_test_zero ()
 Increment the value by one; return true if the new value is zero.
int atomic_add_return (int i)
 Add v to the value and return the new value.
int atomic_sub_return (int i)
 Subtract v from the value and return the new value.
int atomic_incr_return ()
 Increment the value by one and return the new value.
int atomic_decr_return ()
 Decrement the value by one and return the new value.

Static Public Member Functions

static int max_value ()
 Get the maximum representable value.


Constructor & Destructor Documentation

rutz::mutex_atomic_int::mutex_atomic_int  )  [inline]
 

Construct with an initial value of 0.

Definition at line 54 of file atomic_mutex.h.


Member Function Documentation

void rutz::mutex_atomic_int::atomic_add int  i  )  [inline]
 

Add v to the value.

Definition at line 69 of file atomic_mutex.h.

int rutz::mutex_atomic_int::atomic_add_return int  i  )  [inline]
 

Add v to the value and return the new value.

Definition at line 115 of file atomic_mutex.h.

void rutz::mutex_atomic_int::atomic_decr  )  [inline]
 

Decrement the value by one.

Definition at line 91 of file atomic_mutex.h.

int rutz::mutex_atomic_int::atomic_decr_return  )  [inline]
 

Decrement the value by one and return the new value.

Definition at line 145 of file atomic_mutex.h.

Referenced by rutz::string_rep::decr_ref_count(), BufferedInputFrameSeries::get(), BufferedFrameIstream::readFrame(), and nub::ref_counts::release_weak().

bool rutz::mutex_atomic_int::atomic_decr_test_zero  )  [inline]
 

Decrement the value by one; return true if the new value is zero.

Definition at line 95 of file atomic_mutex.h.

Referenced by rutz::shared_ptr< T >::dyn_cast_from(), ArrayData< T >::release(), rutz::shared_array< T >::~shared_array(), and rutz::shared_ptr< T >::~shared_ptr().

int rutz::mutex_atomic_int::atomic_get  )  const [inline]
 

Get the current value.

Definition at line 61 of file atomic_mutex.h.

Referenced by ArrayData< T >::acquire(), nub::ref_counted::dbg_ref_count(), nub::ref_counted::dbg_weak_ref_count(), rutz::string_rep::debug_dump(), nub::ref_counts::debug_dump(), BufferedInputFrameSeries::get(), EyeTrackerISCAN::getCalibEyePos(), Nv2LabelReader::getLastConfidence(), nub::ref_counted::is_shared(), isPaused(), ArrayData< T >::isShared(), nub::ref_counted::mark_as_volatile(), BufferedFrameIstream::readFrame(), TCPcommunicator::receiveIt(), ArrayData< T >::refCount(), nub::ref_counts::release_weak(), BufferedFrameIstream::startStream(), TCPcommunicator::stop1(), rutz::shared_ptr< Mission >::use_count(), rutz::shared_array< T >::use_count(), and nub::ref_counted::~ref_counted().

void rutz::mutex_atomic_int::atomic_incr  )  [inline]
 

Increment the value by one.

Definition at line 87 of file atomic_mutex.h.

Referenced by ArrayData< T >::acquire(), rutz::shared_ptr< T >::dyn_cast_from(), rutz::string_rep::incr_ref_count(), and rutz::shared_array< T >::shared_array().

int rutz::mutex_atomic_int::atomic_incr_return  )  [inline]
 

Increment the value by one and return the new value.

Definition at line 135 of file atomic_mutex.h.

Referenced by nub::ref_counts::acquire_weak().

bool rutz::mutex_atomic_int::atomic_incr_test_zero  )  [inline]
 

Increment the value by one; return true if the new value is zero.

Definition at line 105 of file atomic_mutex.h.

void rutz::mutex_atomic_int::atomic_set int  v  )  [inline]
 

Set value to the given value v.

Definition at line 65 of file atomic_mutex.h.

Referenced by ArrayData< T >::ArrayData(), rutz::shared_ptr< T >::dyn_cast_from(), Nv2LabelReader::getNextLabeledImage(), TCPcommunicator::run(), setPause(), XWinManaged::setTraceEvents(), rutz::shared_array< T >::shared_array(), rutz::shared_ptr< T >::shared_ptr(), TCPcommunicator::start2(), TCPcommunicator::TCPcommunicator(), WorkThreadServer::WorkThreadServer(), and XWinManaged::~XWinManaged().

void rutz::mutex_atomic_int::atomic_sub int  i  )  [inline]
 

Subtract v from the value.

Definition at line 73 of file atomic_mutex.h.

int rutz::mutex_atomic_int::atomic_sub_return int  i  )  [inline]
 

Subtract v from the value and return the new value.

Definition at line 125 of file atomic_mutex.h.

bool rutz::mutex_atomic_int::atomic_sub_test_zero int  i  )  [inline]
 

Subtract v from the value; return true if the new value is zero.

Definition at line 77 of file atomic_mutex.h.

static int rutz::mutex_atomic_int::max_value  )  [inline, static]
 

Get the maximum representable value.

Definition at line 58 of file atomic_mutex.h.

References rutz::max().

Referenced by nub::ref_counts::acquire_weak().


The documentation for this class was generated from the following file:
Generated on Sat Nov 21 13:54:26 2009 for iLab Neuromorphic Vision Toolkit by  doxygen 1.4.4