CoDiPack  2.3.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
codi::AtomicInterface< T_Type, T_Impl > Struct Template Reference

Provides a data type on which all operations are performed atomically. More...

#include <atomicInterface.hpp>

Inheritance diagram for codi::AtomicInterface< T_Type, T_Impl >:

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.
 
Imploperator= (Impl const &other)
 Assignment operator with implementing type as rhs.
 
Imploperator= (Type const &other)
 Assignment operator with underlying type as rhs.
 
 ~AtomicInterface ()
 Destructor.
 

Detailed Description

template<typename T_Type, typename T_Impl>
struct codi::AtomicInterface< T_Type, T_Impl >

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.

Template Parameters
T_TypeThe underlying data type.
T_ImplImplementing class.

The documentation for this struct was generated from the following file: