ITK
4.9.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 71 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 Member Functions | |
typedef (Detail::IsAtomicSupportedIntegralType< T >) SupportedInteger | |
Private Attributes | |
Impl::AtomicType | m_Object |
|
private |
Definition at line 74 of file itkAtomicInt.h.
|
inline |
Definition at line 77 of file itkAtomicInt.h.
|
inline |
Definition at line 81 of file itkAtomicInt.h.
|
inline |
Definition at line 86 of file itkAtomicInt.h.
|
inline |
Definition at line 140 of file itkAtomicInt.h.
Referenced by itk::AtomicInt< int >::operator=().
|
inline |
Definition at line 123 of file itkAtomicInt.h.
References itk::AtomicInt< T >::m_Object.
|
inline |
Definition at line 91 of file itkAtomicInt.h.
|
inline |
Definition at line 96 of file itkAtomicInt.h.
|
inline |
Definition at line 111 of file itkAtomicInt.h.
|
inline |
Definition at line 101 of file itkAtomicInt.h.
|
inline |
Definition at line 106 of file itkAtomicInt.h.
|
inline |
Definition at line 117 of file itkAtomicInt.h.
|
inline |
Definition at line 128 of file itkAtomicInt.h.
|
inline |
Definition at line 134 of file itkAtomicInt.h.
|
inline |
Definition at line 145 of file itkAtomicInt.h.
Referenced by itk::AtomicInt< int >::operator=().
|
private |
This class requires SupportedInteger in the form of ( Detail::IsAtomicSupportedIntegralType<T> )
|
private |
Definition at line 151 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().