The Pedigree Project  0.1
Public Member Functions | Private Attributes | Friends | List of all members
Atomic< T, true > Class Template Reference

#include <Atomic.h>

+ Collaboration diagram for Atomic< T, true >:

Public Member Functions

 Atomic (T value=T())
 
 Atomic (const Atomic &x)
 
Atomicoperator= (const Atomic &x)
 
virtual ~Atomic ()
 
operator+= (T x)
 
operator-= (T x)
 
operator|= (T x)
 
operator&= (T x)
 
operator^= (T x)
 
bool compareAndSwap (T oldVal, T newVal)
 
 operator T () const
 

Private Attributes

volatile T m_Atom
 

Friends

class PerProcessorScheduler
 

Detailed Description

template<typename T>
class Atomic< T, true >

Wrapper around gcc's builtin atomic operations

Definition at line 39 of file Atomic.h.

Constructor & Destructor Documentation

template<typename T >
Atomic< T, true >::Atomic ( value = T())
inline

The constructor

Parameters
[in]valueinitial value

Definition at line 46 of file Atomic.h.

template<typename T >
Atomic< T, true >::Atomic ( const Atomic< T, true > &  x)
inline

The copy-constructor

Parameters
[in]xreference object

Definition at line 51 of file Atomic.h.

template<typename T >
virtual Atomic< T, true >::~Atomic ( )
inlinevirtual

The destructor does nothing

Definition at line 62 of file Atomic.h.

Member Function Documentation

template<typename T >
bool Atomic< T, true >::compareAndSwap ( oldVal,
newVal 
)
inline

Compare and swap

Parameters
[in]oldValthe comparision value
[in]newValthe new value
Returns
true, if the Atomic had the value oldVal and the value was changed to newVal, false otherwise

Definition at line 131 of file Atomic.h.

template<typename T >
Atomic< T, true >::operator T ( ) const
inline

Get the value

Returns
the value of the Atomic

Definition at line 146 of file Atomic.h.

template<typename T >
T Atomic< T, true >::operator&= ( x)
inline

Bitwise and

Parameters
[in]xthe operand
Returns
the value after the bitwise and

Definition at line 105 of file Atomic.h.

template<typename T >
T Atomic< T, true >::operator+= ( x)
inline

Addition

Parameters
[in]xvalue to add
Returns
the value after the addition

Definition at line 69 of file Atomic.h.

template<typename T >
T Atomic< T, true >::operator-= ( x)
inline

Subtraction

Parameters
[in]xvalue to subtract
Returns
the value after the subtraction

Definition at line 81 of file Atomic.h.

template<typename T >
Atomic& Atomic< T, true >::operator= ( const Atomic< T, true > &  x)
inline

The assignment operator

Parameters
[in]xreference object

Definition at line 56 of file Atomic.h.

template<typename T >
T Atomic< T, true >::operator^= ( x)
inline

Bitwise xor

Parameters
[in]xthe operand
Returns
the value after the bitwise xor

Definition at line 117 of file Atomic.h.

template<typename T >
T Atomic< T, true >::operator|= ( x)
inline

Bitwise or

Parameters
[in]xthe operand
Returns
the value after the bitwise or

Definition at line 93 of file Atomic.h.

Member Data Documentation

template<typename T >
volatile T Atomic< T, true >::m_Atom
private

The atomic value

Definition at line 153 of file Atomic.h.


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