OpendTect-6_4  6.4
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Threads::AtomicPointer< T > Class Template Reference

Atomic instantiated with a pointer. The class really only handles the casting from a void* to a T*. More...

Inheritance diagram for Threads::AtomicPointer< T >:
[legend]

Public Member Functions

 AtomicPointer (T *newptr=0)
 
bool setIfEqual (const T *curptr, T *newptr)
 
AtomicPointer< T > & operator= (T *ptr)
 
AtomicPointer< T > & operator= (const AtomicPointer< T > &)
 
T * setToNull ()
 
T * exchange (T *newptr)
 
 operator T * () const
 
T * operator-> ()
 
const T * operator-> () const
 
T * operator+= (int)
 
T * operator-= (int)
 
T * operator++ ()
 
T * operator-- ()
 
T * operator++ (int)
 
T * operator-- (int)
 
const void * getStorage () const
 Only for debugging. More...
 

Private Member Functions

 AtomicPointer (const AtomicPointer< T > &)
 

Private Attributes

Atomic< T * > ptr_
 

Detailed Description

template<class T>
class Threads::AtomicPointer< T >

Atomic instantiated with a pointer. The class really only handles the casting from a void* to a T*.

Constructor & Destructor Documentation

template<class T>
Threads::AtomicPointer< T >::AtomicPointer ( T *  newptr = 0)
inline
template<class T>
Threads::AtomicPointer< T >::AtomicPointer ( const AtomicPointer< T > &  )
inlineprivate

Member Function Documentation

template<class T>
T * Threads::AtomicPointer< T >::exchange ( T *  newptr)
inline
template<class T>
const void* Threads::AtomicPointer< T >::getStorage ( ) const
inline

Only for debugging.

template<class T >
Threads::AtomicPointer< T >::operator T * ( ) const
inline
template<class T >
T * Threads::AtomicPointer< T >::operator++ ( )
inline
template<class T >
T * Threads::AtomicPointer< T >::operator++ ( int  )
inline
template<class T >
T * Threads::AtomicPointer< T >::operator+= ( int  b)
inline
template<class T >
T * Threads::AtomicPointer< T >::operator-- ( )
inline
template<class T >
T * Threads::AtomicPointer< T >::operator-- ( int  )
inline
template<class T >
T * Threads::AtomicPointer< T >::operator-= ( int  b)
inline
template<class T >
T * Threads::AtomicPointer< T >::operator-> ( )
inline
template<class T >
const T * Threads::AtomicPointer< T >::operator-> ( ) const
inline
template<class T>
AtomicPointer< T > & Threads::AtomicPointer< T >::operator= ( T *  ptr)
inline
template<class T>
AtomicPointer< T > & Threads::AtomicPointer< T >::operator= ( const AtomicPointer< T > &  ptr)
inline
template<class T>
bool Threads::AtomicPointer< T >::setIfEqual ( const T *  curptr,
T *  newptr 
)
inline

Sets the 'ptr_' only if its pointer is identical to the pointer in 'curptr'. If the pointer in 'ptr_' is identical to the pointer of 'curptr', function will change 'ptr_' and return true. Otherwise, it will not change 'ptr_', it will return false, and update 'curptr' to the current value of 'ptr'.

template<class T >
T * Threads::AtomicPointer< T >::setToNull ( )
inline

Returns the last value of the ptr.

Member Data Documentation

template<class T>
Atomic< T* > Threads::AtomicPointer< T >::ptr_
private

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