OpendTect  7.0
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 (const AtomicPointer< T > &)=delete
 
 AtomicPointer (T *newptr=0)
 
 operator bool () const
 
bool operator! () const
 
T * operator-> ()
 
const T * operator-> () const
 
AtomicPointer< T > & operator= (const AtomicPointer< T > &)
 
AtomicPointer< T > & operator= (T *ptr)
 
bool setIfEqual (const T *curptr, T *newptr)
 
T * setToNull ()
 

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

◆ AtomicPointer() [1/2]

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

◆ AtomicPointer() [2/2]

template<class T >
Threads::AtomicPointer< T >::AtomicPointer ( const AtomicPointer< T > &  )
inlinedelete

Member Function Documentation

◆ operator bool()

template<class T >
Threads::AtomicPointer< T >::operator bool ( ) const
inline

◆ operator!()

template<class T >
bool Threads::AtomicPointer< T >::operator! ( ) const
inline

◆ operator->() [1/2]

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

◆ operator->() [2/2]

template<class T >
const T* Threads::AtomicPointer< T >::operator-> ( ) const
inline

◆ operator=() [1/2]

template<class T >
AtomicPointer< T > & Threads::AtomicPointer< T >::operator= ( const AtomicPointer< T > &  ptr)
inline

◆ operator=() [2/2]

template<class T >
AtomicPointer< T > & Threads::AtomicPointer< T >::operator= ( T *  ptr)
inline

◆ setIfEqual()

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'.

◆ setToNull()

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. 1995-2024