The Pedigree Project 0.1
Public Member Functions | List of all members
Atomic< bool, true > Class Reference

#include <Atomic.h>

+ Inheritance diagram for Atomic< bool, true >:
+ Collaboration diagram for Atomic< bool, true >:

Public Member Functions

 Atomic (bool value=false)
 
 Atomic (const Atomic &x)
 
Atomic & operator= (const Atomic &x)
 
Atomic & operator= (bool x)
 
virtual ~Atomic ()
 
bool operator|= (bool x)
 
bool operator&= (bool x)
 
bool operator^= (bool x)
 
bool compareAndSwap (bool oldVal, bool newVal)
 
 operator bool () const
 

Detailed Description

Wrapper around gcc's builtin atomic operations

Definition at line 120 of file Atomic.h.

Constructor & Destructor Documentation

◆ Atomic() [1/2]

Atomic< bool, true >::Atomic ( bool  value = false)
inline

The constructor

Parameters
[in]valueinitial value

Definition at line 124 of file Atomic.h.

◆ Atomic() [2/2]

Atomic< bool, true >::Atomic ( const Atomic< bool, true > &  x)
inline

The copy-constructor

Parameters
[in]xreference object

Definition at line 127 of file Atomic.h.

◆ ~Atomic()

Atomic< bool, true >::~Atomic ( )
virtual

The destructor does nothing

Definition at line 23 of file Atomic.cc.

Member Function Documentation

◆ compareAndSwap()

bool Atomic< bool, true >::compareAndSwap ( bool  oldVal,
bool  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 165 of file Atomic.h.

◆ operator bool()

Atomic< bool, true >::operator bool ( ) const
inline

Get the value

Returns
the value of the Atomic

Definition at line 170 of file Atomic.h.

◆ operator&=()

bool Atomic< bool, true >::operator&= ( bool  x)
inline

Bitwise and

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

Definition at line 151 of file Atomic.h.

◆ operator=() [1/2]

Atomic & Atomic< bool, true >::operator= ( bool  x)
inline

Atomically stores a boolean value.

Definition at line 135 of file Atomic.h.

◆ operator=() [2/2]

Atomic & Atomic< bool, true >::operator= ( const Atomic< bool, true > &  x)
inline

The assignment operator

Parameters
[in]xreference object

Definition at line 130 of file Atomic.h.

◆ operator^=()

bool Atomic< bool, true >::operator^= ( bool  x)
inline

Bitwise xor

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

Definition at line 157 of file Atomic.h.

◆ operator|=()

bool Atomic< bool, true >::operator|= ( bool  x)
inline

Bitwise or

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

Definition at line 145 of file Atomic.h.


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