Provides a data type on which all operations are performed atomically. More...
#include <atomicInterface.hpp>
Public Types | |
using | Impl = T_Impl |
See AtomicInterface. | |
using | Type = T_Type |
See AtomicInterface. | |
Public Member Functions | |
AtomicInterface () | |
Constructor. | |
AtomicInterface (AtomicInterface const &) | |
Constructor. | |
AtomicInterface (Type const &) | |
Constructor. | |
operator Type () const | |
Implicit cast to underlying type for rhs access. | |
Type | operator++ () |
Pre-increment operator. | |
Type | operator++ (int) |
Post-increment operator. | |
Type | operator+= (Impl const &other) |
Incremental update with implementing type as rhs. | |
Type | operator+= (Type const &other) |
Incremental update with underlying type as rhs. | |
Type | operator-- () |
Pre-decrement operator. | |
Type | operator-- (int) |
Post-decrement operator. | |
Impl & | operator= (Impl const &other) |
Assignment operator with implementing type as rhs. | |
Impl & | operator= (Type const &other) |
Assignment operator with underlying type as rhs. | |
~AtomicInterface () | |
Destructor. | |
Provides a data type on which all operations are performed atomically.
Provides also increment and decrement operators for the use case of an underlying integer type. The increment and decrement operators don't have to be implemented for underlying non-integer types.
If used with an underlying floating point type or an active CoDiPack type, this data type is suitable as an adjoint variable type. Note, however, that it is not optimal because it performs all operations atomically. Data types derived from ReverseAtomicInterface are preferred as adjoint variable types.
Implementations likely require template specializations with respect to the underlying type, especially if it is an active CoDiPack type.
An implementation should preserve the memory footprint of the underlying type, e.g., by inheriting from the under- lying type or by having a variable of the underlying type as the only member variable.
T_Type | The underlying data type. |
T_Impl | Implementing class. |