ITK
4.13.0
Insight Segmentation and Registration Toolkit
|
#include <itkAtomicInt.h>
Provides support for atomic integers.
Objects of atomic types are C++ objects that are free from data races; that is, if one thread writes to an atomic object while another thread reads from it, the behavior is well-defined. AtomicInt provides a subset of the std::atomic API and implementation, for 32 bit and 64 bit integers and pointer types. For these types, AtomicInt defines a number of operations that happen atomically - without interruption by another thread. Furthermore, these operations happen in a sequentially-consistent way and use full memory fences. This means that operations relating to atomic variables happen in the specified order and the results are made visible to other processing cores to guarantee proper sequential operation. Other memory access patterns supported by std::atomic are not currently supported.
Note that when atomic operations are not available on a particular platform or compiler, mutexes, which are significantly slower, are used as a fallback.
Definition at line 78 of file itkAtomicInt.h.
Public Member Functions | |
AtomicInt () | |
AtomicInt (T val) | |
AtomicInt (const AtomicInt< T > &ai) | |
T | load () const |
operator T () const | |
T | operator++ () |
T | operator++ (int) |
T | operator+= (T val) |
T | operator-- () |
T | operator-- (int) |
T | operator-= (T val) |
T | operator= (T val) |
AtomicInt< T > & | operator= (const AtomicInt< T > &ai) |
void | store (T val) |
Private Types | |
typedef Detail::AtomicOps < sizeof(T)> | Impl |
Private Attributes | |
Impl::AtomicType | m_Object |
|
private |
Definition at line 81 of file itkAtomicInt.h.
|
inline |
Definition at line 85 of file itkAtomicInt.h.
|
inline |
Definition at line 89 of file itkAtomicInt.h.
|
inline |
Definition at line 94 of file itkAtomicInt.h.
|
inline |
Definition at line 148 of file itkAtomicInt.h.
Referenced by itk::AtomicInt< int >::operator=().
|
inline |
Definition at line 131 of file itkAtomicInt.h.
References itk::AtomicInt< T >::m_Object.
|
inline |
Definition at line 99 of file itkAtomicInt.h.
|
inline |
Definition at line 104 of file itkAtomicInt.h.
|
inline |
Definition at line 119 of file itkAtomicInt.h.
|
inline |
Definition at line 109 of file itkAtomicInt.h.
|
inline |
Definition at line 114 of file itkAtomicInt.h.
|
inline |
Definition at line 125 of file itkAtomicInt.h.
|
inline |
Definition at line 136 of file itkAtomicInt.h.
|
inline |
Definition at line 142 of file itkAtomicInt.h.
|
inline |
Definition at line 153 of file itkAtomicInt.h.
Referenced by itk::AtomicInt< int >::operator=().
|
private |
Definition at line 159 of file itkAtomicInt.h.
Referenced by itk::AtomicInt< int >::load(), itk::AtomicInt< T >::operator T(), itk::AtomicInt< int >::operator++(), itk::AtomicInt< int >::operator+=(), itk::AtomicInt< int >::operator--(), itk::AtomicInt< int >::operator-=(), itk::AtomicInt< int >::operator=(), and itk::AtomicInt< int >::store().