rpa::atomic_mutex< Iter, Mutex > Struct Template Reference

For implementing atomic access to a datatype without atomic operations. More...

#include <atomic.h>

Inheritance diagram for rpa::atomic_mutex< Iter, Mutex >:

rpa::atomic< deque< double >::const_iterator > rpa::atomic< double_list_const_iter_t > rpa::atomic< double_vector_const_iter_t > rpa::atomic< RPA_LIST_ITERATOR(Type) > rpa::atomic< RPA_LIST_ITERATOR_CONST(Type) > rpa::atomic< RPA_SET_ITERATOR(Type) > rpa::atomic< RPA_SET_ITERATOR_CONST(Type) > rpa::atomic< RPA_VECTOR_ITERATOR(Type, Alloc) > rpa::atomic< RPA_VECTOR_ITERATOR_CONST(Type, Alloc) > rpa::atomic< set< double >::const_iterator > rpa::atomic< std::back_insert_iterator< Type > > rpa::atomic< string_vector_const_iter_t > rpa::atomic< string_vector_iter_t > List of all members.

Public Types

typedef Iter data_type
 Uses the name 'Iter' because iterators are the commonest template parameter.

Static Public Member Functions

static void store (atomic_type &anIt, const data_type &aVal)
 Atomically stores the value into the atomic type, protected by the mutex.
static Iter load (const atomic_type &anIt)
static void incr (atomic_type &anIt)
static const Iter & value (const atomic_type &anIt)

Classes

class  atomic_type
 Atomic data type associated to 'Iter'. More...

Detailed Description

template<class Iter, class Mutex>
struct rpa::atomic_mutex< Iter, Mutex >

For implementing atomic access to a datatype without atomic operations.

For example, for a complicated datatype. This is slow, but allows to compile, link and run. This is also a good platform for testing for race conditions, by changing the synchronization primitives, while retaining exactly the same scheme.


Member Typedef Documentation

template<class Iter, class Mutex>
typedef Iter rpa::atomic_mutex< Iter, Mutex >::data_type

Uses the name 'Iter' because iterators are the commonest template parameter.


Member Function Documentation

template<class Iter, class Mutex>
static void rpa::atomic_mutex< Iter, Mutex >::incr ( atomic_type anIt  )  [inline, static]

template<class Iter, class Mutex>
static Iter rpa::atomic_mutex< Iter, Mutex >::load ( const atomic_type anIt  )  [inline, static]

template<class Iter, class Mutex>
static void rpa::atomic_mutex< Iter, Mutex >::store ( atomic_type anIt,
const data_type aVal 
) [inline, static]

Atomically stores the value into the atomic type, protected by the mutex.

template<class Iter, class Mutex>
static const Iter& rpa::atomic_mutex< Iter, Mutex >::value ( const atomic_type anIt  )  [inline, static]


The documentation for this struct was generated from the following file:
Generated on Tue Sep 25 10:20:34 2007 for rpa by  doxygen 1.4.7