OpendTect  6.3
Public Member Functions | 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)
 
bool operator! () const
 
 operator bool () const
 
T * operator-> ()
 
const T * operator-> () const
 
AtomicPointer< T > & operator= (T *ptr)
 
AtomicPointer< T > & operator= (const AtomicPointer< T > &)
 
T * setToNull ()
 
 AtomicPointer (const AtomicPointer< T > &)=delete
 

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 > &  )
inlinedelete

Member Function Documentation

template<class T>
Threads::AtomicPointer< T >::operator bool ( ) const
inline
template<class T>
bool Threads::AtomicPointer< T >::operator! ( ) const
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.


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