OpendTect-6_4  6.4
Public Member Functions | Private Attributes | List of all members
Threads::Atomic< T > Class Template Reference
Inheritance diagram for Threads::Atomic< T >:
[legend]

Public Member Functions

 Atomic (T val=0)
 
 Atomic (const Atomic &)
 
 ~Atomic ()
 
 operator T () const
 
get () const
 
operator= (T v)
 
operator= (const Atomic< T > &v)
 
operator+= (T)
 
operator-= (T)
 
operator++ ()
 
operator-- ()
 
operator++ (int)
 
operator-- (int)
 
exchange (T newval)
 
bool setIfValueIs (T curval, T newval, T *actualvalptr)
 
const void * getStorage () const
 Only for debugging. More...
 
template<>
bool setIfValueIs (int curval, int newval, int *actualvalptr)
 

Private Attributes

volatile T val_
 

Detailed Description

template<class T>
class Threads::Atomic< T >

Constructor & Destructor Documentation

template<class T>
Threads::Atomic< T >::Atomic ( val = 0)
inline
template<class T>
Threads::Atomic< T >::Atomic ( const Atomic< T > &  oth)
inline
template<class T >
Threads::Atomic< T >::~Atomic< T > ( )
inline

Member Function Documentation

template<class T>
T Threads::Atomic< T >::exchange ( newval)
inline

Returns old value.

template<class T >
T Threads::Atomic< T >::get ( ) const
inline
template<class T >
const void * Threads::Atomic< T >::getStorage ( ) const
inline

Only for debugging.

template<class T>
Threads::Atomic< T >::operator T ( ) const
inline
template<class T >
T Threads::Atomic< T >::operator++ ( )
inline
template<class T >
T Threads::Atomic< T >::operator++ ( int  )
inline
template<class T>
T Threads::Atomic< T >::operator+= ( b)
inline
template<class T >
T Threads::Atomic< T >::operator-- ( )
inline
template<class T >
T Threads::Atomic< T >::operator-- ( int  )
inline
template<class T>
T Threads::Atomic< T >::operator-= ( b)
inline
template<class T>
T Threads::Atomic< T >::operator= ( v)
inline
template<class T>
T Threads::Atomic< T >::operator= ( const Atomic< T > &  v)
inline
template<class T>
bool Threads::Atomic< T >::setIfValueIs ( curval,
newval,
T *  actualvalptr 
)
inline

Sets the 'val_' only if its value is currently the value of 'curval'. If the value in 'val_' is identical to the value of 'curval', function will change 'val_' and return true. Otherwise, it will not change 'val_', it will return false, and update set the content of 'actualvalptr' to the current value of 'val_'.

template<>
bool Threads::Atomic< int >::setIfValueIs ( int  curval,
int  newval,
int *  actualvalptr 
)
inline

Member Data Documentation

template<class T>
volatile T Threads::Atomic< T >::val_
private

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019