Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::internal::atomic_impl_with_arithmetic< I, D, StepType > Struct Template Reference

Base class that provides basic functionality for atomic<T> with fetch_and_add. More...

#include <atomic.h>

Inheritance diagram for tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >:
Collaboration diagram for tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >:

Public Types

typedef I value_type
 
- Public Types inherited from tbb::internal::atomic_impl< I >
typedef I value_type
 

Public Member Functions

 atomic_impl_with_arithmetic ()=default
 
constexpr atomic_impl_with_arithmetic (value_type value)
 
template<memory_semantics M>
value_type fetch_and_add (D addend)
 
value_type fetch_and_add (D addend)
 
template<memory_semantics M>
value_type fetch_and_increment ()
 
value_type fetch_and_increment ()
 
template<memory_semantics M>
value_type fetch_and_decrement ()
 
value_type fetch_and_decrement ()
 
value_type operator+= (D value)
 
value_type operator-= (D value)
 
value_type operator++ ()
 
value_type operator-- ()
 
value_type operator++ (int)
 
value_type operator-- (int)
 
- Public Member Functions inherited from tbb::internal::atomic_impl< I >
 atomic_impl ()=default
 
constexpr atomic_impl (value_type value)
 
value_type fetch_and_store (value_type value)
 
value_type fetch_and_store (value_type value)
 
value_type compare_and_swap (value_type value, value_type comparand)
 
value_type compare_and_swap (value_type value, value_type comparand)
 
 operator value_type () const volatile
 
value_type load () const
 
value_type load () const
 
void store (value_type value)
 
void store (value_type value)
 

Additional Inherited Members

- Protected Member Functions inherited from tbb::internal::atomic_impl< I >
value_type store_with_release (value_type rhs)
 
- Protected Attributes inherited from tbb::internal::atomic_impl< I >
aligned_storage< I, sizeof(I)> my_storage
 

Detailed Description

template<typename I, typename D, typename StepType>
struct tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >

Base class that provides basic functionality for atomic<T> with fetch_and_add.

I is the underlying type. D is the difference type. StepType should be char if I is an integral type, and T if I is a T*.

Definition at line 348 of file atomic.h.

Member Typedef Documentation

◆ value_type

template<typename I , typename D , typename StepType >
typedef I tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::value_type

Definition at line 350 of file atomic.h.

Constructor & Destructor Documentation

◆ atomic_impl_with_arithmetic() [1/2]

template<typename I , typename D , typename StepType >
tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::atomic_impl_with_arithmetic ( )
default

◆ atomic_impl_with_arithmetic() [2/2]

template<typename I , typename D , typename StepType >
constexpr tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::atomic_impl_with_arithmetic ( value_type  value)
inline

Definition at line 353 of file atomic.h.

353 : atomic_impl<I>(value){}
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value

Member Function Documentation

◆ fetch_and_add() [1/2]

template<typename I , typename D , typename StepType >
template<memory_semantics M>
value_type tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::fetch_and_add ( addend)
inline

Definition at line 356 of file atomic.h.

356  {
357  return value_type(internal::atomic_traits<sizeof(value_type),M>::fetch_and_add( &this->my_storage.my_value, addend*sizeof(StepType) ));
358  }
aligned_storage< I, sizeof(I)> my_storage
Definition: atomic.h:232
value_type fetch_and_add(D addend)
Definition: atomic.h:356

References tbb::internal::atomic_impl< I >::my_storage.

Referenced by tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::fetch_and_decrement(), tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::fetch_and_increment(), tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::operator++(), tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::operator+=(), and tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::operator--().

Here is the caller graph for this function:

◆ fetch_and_add() [2/2]

template<typename I , typename D , typename StepType >
value_type tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::fetch_and_add ( addend)
inline

Definition at line 360 of file atomic.h.

360  {
361  return fetch_and_add<full_fence>(addend);
362  }

◆ fetch_and_decrement() [1/2]

template<typename I , typename D , typename StepType >
template<memory_semantics M>
value_type tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::fetch_and_decrement ( )
inline

Definition at line 374 of file atomic.h.

374  {
375  return fetch_and_add<M>(__TBB_MINUS_ONE(D));
376  }
#define __TBB_MINUS_ONE(T)
Additive inverse of 1 for type T.
Definition: atomic.h:224

References __TBB_MINUS_ONE.

◆ fetch_and_decrement() [2/2]

template<typename I , typename D , typename StepType >
value_type tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::fetch_and_decrement ( )
inline

Definition at line 378 of file atomic.h.

378  {
379  return fetch_and_add(__TBB_MINUS_ONE(D));
380  }
#define __TBB_MINUS_ONE(T)
Additive inverse of 1 for type T.
Definition: atomic.h:224
value_type fetch_and_add(D addend)
Definition: atomic.h:356

References __TBB_MINUS_ONE, and tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::fetch_and_add().

Here is the call graph for this function:

◆ fetch_and_increment() [1/2]

template<typename I , typename D , typename StepType >
template<memory_semantics M>
value_type tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::fetch_and_increment ( )
inline

Definition at line 365 of file atomic.h.

365  {
366  return fetch_and_add<M>(1);
367  }

◆ fetch_and_increment() [2/2]

template<typename I , typename D , typename StepType >
value_type tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::fetch_and_increment ( )
inline

Definition at line 369 of file atomic.h.

369  {
370  return fetch_and_add(1);
371  }
value_type fetch_and_add(D addend)
Definition: atomic.h:356

References tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::fetch_and_add().

Here is the call graph for this function:

◆ operator++() [1/2]

template<typename I , typename D , typename StepType >
value_type tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::operator++ ( )
inline

Definition at line 393 of file atomic.h.

393  {
394  return fetch_and_add(1)+1;
395  }
value_type fetch_and_add(D addend)
Definition: atomic.h:356

References tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::fetch_and_add().

Here is the call graph for this function:

◆ operator++() [2/2]

template<typename I , typename D , typename StepType >
value_type tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::operator++ ( int  )
inline

Definition at line 401 of file atomic.h.

401  {
402  return fetch_and_add(1);
403  }
value_type fetch_and_add(D addend)
Definition: atomic.h:356

References tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::fetch_and_add().

Here is the call graph for this function:

◆ operator+=()

template<typename I , typename D , typename StepType >
value_type tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::operator+= ( value)
inline

Definition at line 383 of file atomic.h.

383  {
384  return fetch_and_add(value)+value;
385  }
value_type fetch_and_add(D addend)
Definition: atomic.h:356
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value

References tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::fetch_and_add(), and value.

Referenced by tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::operator-=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator--() [1/2]

template<typename I , typename D , typename StepType >
value_type tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::operator-- ( )
inline

Definition at line 397 of file atomic.h.

397  {
398  return fetch_and_add(__TBB_MINUS_ONE(D))-1;
399  }
#define __TBB_MINUS_ONE(T)
Additive inverse of 1 for type T.
Definition: atomic.h:224
value_type fetch_and_add(D addend)
Definition: atomic.h:356

References __TBB_MINUS_ONE, and tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::fetch_and_add().

Here is the call graph for this function:

◆ operator--() [2/2]

template<typename I , typename D , typename StepType >
value_type tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::operator-- ( int  )
inline

Definition at line 405 of file atomic.h.

405  {
406  return fetch_and_add(__TBB_MINUS_ONE(D));
407  }
#define __TBB_MINUS_ONE(T)
Additive inverse of 1 for type T.
Definition: atomic.h:224
value_type fetch_and_add(D addend)
Definition: atomic.h:356

References __TBB_MINUS_ONE, and tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::fetch_and_add().

Here is the call graph for this function:

◆ operator-=()

template<typename I , typename D , typename StepType >
value_type tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::operator-= ( value)
inline

Definition at line 387 of file atomic.h.

387  {
388  // Additive inverse of value computed using binary minus,
389  // instead of unary minus, for sake of avoiding compiler warnings.
390  return operator+=(D(0)-value);
391  }
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value

References tbb::internal::atomic_impl_with_arithmetic< I, D, StepType >::operator+=(), and value.

Here is the call graph for this function:

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

Copyright © 2005-2020 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.