rutz::darwin_atomic_int Class Reference

Atomic integer operations implemented using Apple Darwin's OSAtomicAdd32Barrier(). More...

#include <rutz/atomic_darwin.h>

List of all members.

Public Member Functions

 darwin_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.

Detailed Description

Atomic integer operations implemented using Apple Darwin's OSAtomicAdd32Barrier().

Definition at line 43 of file atomic_darwin.h.


Constructor & Destructor Documentation

rutz::darwin_atomic_int::darwin_atomic_int (  )  [inline]

Construct with an initial value of 0.

Definition at line 53 of file atomic_darwin.h.


Member Function Documentation

void rutz::darwin_atomic_int::atomic_add ( int  i  )  [inline]

Add v to the value.

Definition at line 67 of file atomic_darwin.h.

int rutz::darwin_atomic_int::atomic_add_return ( int  i  )  [inline]

Add v to the value and return the new value.

Definition at line 95 of file atomic_darwin.h.

void rutz::darwin_atomic_int::atomic_decr (  )  [inline]

Decrement the value by one.

Definition at line 83 of file atomic_darwin.h.

int rutz::darwin_atomic_int::atomic_decr_return (  )  [inline]

Decrement the value by one and return the new value.

Definition at line 107 of file atomic_darwin.h.

bool rutz::darwin_atomic_int::atomic_decr_test_zero (  )  [inline]

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

Definition at line 87 of file atomic_darwin.h.

int rutz::darwin_atomic_int::atomic_get (  )  const [inline]

Get the current value.

Definition at line 59 of file atomic_darwin.h.

void rutz::darwin_atomic_int::atomic_incr (  )  [inline]

Increment the value by one.

Definition at line 79 of file atomic_darwin.h.

int rutz::darwin_atomic_int::atomic_incr_return (  )  [inline]

Increment the value by one and return the new value.

Definition at line 103 of file atomic_darwin.h.

bool rutz::darwin_atomic_int::atomic_incr_test_zero (  )  [inline]

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

Definition at line 91 of file atomic_darwin.h.

void rutz::darwin_atomic_int::atomic_set ( int  v  )  [inline]

Set value to the given value v.

Definition at line 63 of file atomic_darwin.h.

void rutz::darwin_atomic_int::atomic_sub ( int  i  )  [inline]

Subtract v from the value.

Definition at line 71 of file atomic_darwin.h.

int rutz::darwin_atomic_int::atomic_sub_return ( int  i  )  [inline]

Subtract v from the value and return the new value.

Definition at line 99 of file atomic_darwin.h.

bool rutz::darwin_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 75 of file atomic_darwin.h.

static int rutz::darwin_atomic_int::max_value (  )  [inline, static]

Get the maximum representable value.

Definition at line 56 of file atomic_darwin.h.

References max().


The documentation for this class was generated from the following file:
Generated on Sun May 8 08:44:43 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3