QBasicAtomicPointer< T > Class Template Reference

QBasicAtomicPointer< T > Class Template Reference

#include <qbasicatomic.h>

Class Description

template<typename T>
class QBasicAtomicPointer< T >

Definition at line 131 of file qbasicatomic.h.

+ Inheritance diagram for QBasicAtomicPointer< T >:

Public Member Functions

bool operator== (T *value) const
 
bool operator!= (T *value) const
 
bool operator! () const
 
 operator T * () const
 
T * operator-> () const
 
QBasicAtomicPointer< T > & operator= (T *value)
 
bool testAndSetRelaxed (T *expectedValue, T *newValue)
 
bool testAndSetAcquire (T *expectedValue, T *newValue)
 
bool testAndSetRelease (T *expectedValue, T *newValue)
 
bool testAndSetOrdered (T *expectedValue, T *newValue)
 
T * fetchAndStoreRelaxed (T *newValue)
 
T * fetchAndStoreAcquire (T *newValue)
 
T * fetchAndStoreRelease (T *newValue)
 
T * fetchAndStoreOrdered (T *newValue)
 
T * fetchAndAddRelaxed (qptrdiff valueToAdd)
 
T * fetchAndAddAcquire (qptrdiff valueToAdd)
 
T * fetchAndAddRelease (qptrdiff valueToAdd)
 
T * fetchAndAddOrdered (qptrdiff valueToAdd)
 

Static Public Member Functions

static bool isTestAndSetNative ()
 
static bool isTestAndSetWaitFree ()
 
static bool isFetchAndStoreNative ()
 
static bool isFetchAndStoreWaitFree ()
 
static bool isFetchAndAddNative ()
 
static bool isFetchAndAddWaitFree ()
 

Public Attributes

union {
   T *volatile   _q_value
 
   qint64 volatile   _q_value_integral
 
}; 
 

Member Function Documentation

bool operator== ( T *  value) const
inline

Definition at line 152 of file qbasicatomic.h.

153  {
154  return _q_value == value;
155  }
T *volatile _q_value
Definition: qbasicatomic.h:139
GLsizei const GLfloat * value
Definition: GLee.h:1742
bool operator!= ( T *  value) const
inline

Definition at line 157 of file qbasicatomic.h.

158  {
159  return !operator==(value);
160  }
bool operator==(T *value) const
Definition: qbasicatomic.h:152
GLsizei const GLfloat * value
Definition: GLee.h:1742
bool operator! ( void  ) const
inline

Definition at line 162 of file qbasicatomic.h.

163  {
164  return operator==(0);
165  }
bool operator==(T *value) const
Definition: qbasicatomic.h:152
operator T * ( ) const
inline

Definition at line 167 of file qbasicatomic.h.

168  {
169  return _q_value;
170  }
T *volatile _q_value
Definition: qbasicatomic.h:139
T* operator-> ( void  ) const
inline

Definition at line 172 of file qbasicatomic.h.

173  {
174  return _q_value;
175  }
T *volatile _q_value
Definition: qbasicatomic.h:139
QBasicAtomicPointer<T>& operator= ( T *  value)
inline

Definition at line 177 of file qbasicatomic.h.

178  {
179 #ifdef QT_ARCH_PARISC
180  this->_q_lock[0] = this->_q_lock[1] = this->_q_lock[2] = this->_q_lock[3] = -1;
181 #endif
182  _q_value = value;
183  return *this;
184  }
T *volatile _q_value
Definition: qbasicatomic.h:139
GLsizei const GLfloat * value
Definition: GLee.h:1742
Q_INLINE_TEMPLATE bool isTestAndSetNative ( )
static

Definition at line 80 of file qatomic_alpha.h.

81 { return true; }
Q_INLINE_TEMPLATE bool isTestAndSetWaitFree ( )
static

Definition at line 83 of file qatomic_alpha.h.

84 { return false; }
Q_INLINE_TEMPLATE bool testAndSetRelaxed ( T *  expectedValue,
T *  newValue 
)

Definition at line 551 of file qatomic_alpha.h.

552 {
553  return q_atomic_test_and_set_ptr(&_q_value, expectedValue, newValue) != 0;
554 }
Q_CORE_EXPORT int q_atomic_test_and_set_ptr(volatile void *ptr, void *expected, void *newval)
T *volatile _q_value
Definition: qbasicatomic.h:139
Q_INLINE_TEMPLATE bool testAndSetAcquire ( T *  expectedValue,
T *  newValue 
)

Definition at line 557 of file qatomic_alpha.h.

558 {
559  return q_atomic_test_and_set_acquire_ptr(&_q_value, expectedValue, newValue) != 0;
560 }
Q_CORE_EXPORT int q_atomic_test_and_set_acquire_ptr(volatile void *ptr, void *expected, void *newval)
T *volatile _q_value
Definition: qbasicatomic.h:139
Q_INLINE_TEMPLATE bool testAndSetRelease ( T *  expectedValue,
T *  newValue 
)

Definition at line 563 of file qatomic_alpha.h.

564 {
565  return q_atomic_test_and_set_release_ptr(&_q_value, expectedValue, newValue) != 0;
566 }
T *volatile _q_value
Definition: qbasicatomic.h:139
Q_CORE_EXPORT int q_atomic_test_and_set_release_ptr(volatile void *ptr, void *expected, void *newval)
Q_INLINE_TEMPLATE bool testAndSetOrdered ( T *  expectedValue,
T *  newValue 
)

Definition at line 621 of file qatomic_alpha.h.

622 {
623  return testAndSetAcquire(expectedValue, newValue);
624 }
bool testAndSetAcquire(T *expectedValue, T *newValue)
Q_INLINE_TEMPLATE bool isFetchAndStoreNative ( )
static

Definition at line 89 of file qatomic_alpha.h.

90 { return true; }
Q_INLINE_TEMPLATE bool isFetchAndStoreWaitFree ( )
static

Definition at line 92 of file qatomic_alpha.h.

93 { return false; }
Q_INLINE_TEMPLATE T * fetchAndStoreRelaxed ( T *  newValue)

Definition at line 569 of file qatomic_alpha.h.

570 {
571  return reinterpret_cast<T *>(q_atomic_set_ptr(&_q_value, newValue));
572 }
T *volatile _q_value
Definition: qbasicatomic.h:139
Q_CORE_EXPORT void * q_atomic_set_ptr(volatile void *ptr, void *newval)
Q_INLINE_TEMPLATE T * fetchAndStoreAcquire ( T *  newValue)

Definition at line 575 of file qatomic_alpha.h.

576 {
577  return reinterpret_cast<T *>(q_atomic_fetch_and_store_acquire_ptr(&_q_value, newValue));
578 }
int q_atomic_fetch_and_store_acquire_ptr(volatile void *ptr, void *newValue)
T *volatile _q_value
Definition: qbasicatomic.h:139
Q_INLINE_TEMPLATE T * fetchAndStoreRelease ( T *  newValue)

Definition at line 581 of file qatomic_alpha.h.

582 {
583  return reinterpret_cast<T *>(q_atomic_fetch_and_store_release_ptr(&_q_value, newValue));
584 }
int q_atomic_fetch_and_store_release_ptr(volatile void *ptr, void *newValue)
T *volatile _q_value
Definition: qbasicatomic.h:139
Q_INLINE_TEMPLATE T * fetchAndStoreOrdered ( T *  newValue)

Definition at line 627 of file qatomic_alpha.h.

628 {
629  return fetchAndStoreAcquire(newValue);
630 }
T * fetchAndStoreAcquire(T *newValue)
Q_INLINE_TEMPLATE bool isFetchAndAddNative ( )
static

Definition at line 98 of file qatomic_alpha.h.

99 { return true; }
Q_INLINE_TEMPLATE bool isFetchAndAddWaitFree ( )
static

Definition at line 101 of file qatomic_alpha.h.

102 { return false; }
Q_INLINE_TEMPLATE T * fetchAndAddRelaxed ( qptrdiff  valueToAdd)

Definition at line 587 of file qatomic_alpha.h.

588 {
589  return reinterpret_cast<T *>(q_atomic_fetch_and_add_ptr(&_q_value, newValue));
590 }
Q_CORE_EXPORT void * q_atomic_fetch_and_add_ptr(volatile void *ptr, int value)
T *volatile _q_value
Definition: qbasicatomic.h:139
Q_INLINE_TEMPLATE T * fetchAndAddAcquire ( qptrdiff  valueToAdd)

Definition at line 592 of file qatomic_alpha.h.

593 {
594  return reinterpret_cast<T *>(q_atomic_fetch_and_add_acquire_ptr(&_q_value, newValue));
595 }
void * q_atomic_fetch_and_add_acquire_ptr(volatile void *ptr, qptrdiff valueToAdd)
T *volatile _q_value
Definition: qbasicatomic.h:139
Q_INLINE_TEMPLATE T * fetchAndAddRelease ( qptrdiff  valueToAdd)

Definition at line 598 of file qatomic_alpha.h.

599 {
600  return reinterpret_cast<T *>(q_atomic_fetch_and_add_release_ptr(&_q_value, newValue));
601 }
void * q_atomic_fetch_and_add_release_ptr(volatile void *ptr, qptrdiff valueToAdd)
T *volatile _q_value
Definition: qbasicatomic.h:139
Q_INLINE_TEMPLATE T * fetchAndAddOrdered ( qptrdiff  valueToAdd)

Definition at line 633 of file qatomic_alpha.h.

634 {
635  return fetchAndAddAcquire(valueToAdd);
636 }
T * fetchAndAddAcquire(qptrdiff valueToAdd)

Member Data Documentation

T* volatile _q_value

Definition at line 139 of file qbasicatomic.h.

qint64 volatile _q_value_integral

Definition at line 145 of file qbasicatomic.h.

union { ... }

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