tbb::combinable< T > Class Template Reference
Containers

Thread-local storage with optional reduction. More...

`#include <combinable.h>`

Collaboration diagram for tbb::combinable< T >:

## Public Member Functions

| combinable ()
template<typename finit >
| combinable (finit _finit)
| ~combinable ()
| destructor More...
| combinable (const combinable &other)
| combinable (combinable &&other)
combinable & | operator= (const combinable &other)
combinable & | operator= (combinable &&other)
void | clear ()
T & | local ()
T & | local (bool &exists)
template<typename combine_func_t >
T | combine (combine_func_t f_combine)
template<typename combine_func_t >
void | combine_each (combine_func_t f_combine)

## Private Types

typedef tbb::cache_aligned_allocator< T > | my_alloc
typedef tbb::enumerable_thread_specific< T, my_alloc, ets_no_key > | my_ets_type

## Private Attributes

my_ets_type | my_ets

## Detailed Description

### template<typename T>
class tbb::combinable< T >

Thread-local storage with optional reduction.

Definition at line 33 of file combinable.h.

## Member Typedef Documentation

## my_alloc

template<typename T >

typedef tbb::cache_aligned_allocator<T> tbb::combinable< T >::my_alloc

private

Definition at line 36 of file combinable.h.

## my_ets_type

template<typename T >

typedef tbb::enumerable_thread_specific<T, my_alloc, ets_no_key> tbb::combinable< T >::my_ets_type

private

Definition at line 37 of file combinable.h.

## Constructor & Destructor Documentation

## combinable() [1/4]

template<typename T >

tbb::combinable< T >::combinable | ( |  | ) |

inline

Definition at line 42 of file combinable.h.

{ }

## combinable() [2/4]

template<typename T >
template<typename finit >

tbb::combinable< T >::combinable | ( | finit | _finit | ) |

inline explicit

Definition at line 45 of file combinable.h.

: my_ets(_finit) { }
tbb::combinable::my_ets
my_ets_type my_ets
Definition: combinable.h:38

## ~combinable()

template<typename T >

tbb::combinable< T >::~combinable | ( |  | ) |

inline

destructor

Definition at line 48 of file combinable.h.

{ }

## combinable() [3/4]

template<typename T >

tbb::combinable< T >::combinable | ( | const combinable< T > & | other | ) |

inline

Definition at line 50 of file combinable.h.

: my_ets(other.my_ets) { }

## combinable() [4/4]

template<typename T >

tbb::combinable< T >::combinable | ( | combinable< T > && | other | ) |

inline

Definition at line 53 of file combinable.h.

: my_ets( std::move(other.my_ets)) { }
tbb::move
void move(tbb_thread &t1, tbb_thread &t2)
Definition: tbb_thread.h:319

## Member Function Documentation

## clear()

template<typename T >

void tbb::combinable< T >::clear | ( |  | ) |

inline

Definition at line 68 of file combinable.h.

{ my_ets.clear(); }
tbb::interface6::enumerable_thread_specific::clear
void clear()
Destroys local copies.
Definition: enumerable_thread_specific.h:963

References tbb::interface6::enumerable_thread_specific< T, Allocator, ETS_key_type >::clear(), and tbb::combinable< T >::my_ets.

Here is the call graph for this function:

## combine()

template<typename T >
template<typename combine_func_t >

T tbb::combinable< T >::combine | ( | combine_func_t | f_combine | ) |

inline

Definition at line 76 of file combinable.h.

{ return my_ets.combine(f_combine); }
tbb::interface6::enumerable_thread_specific::combine
T combine(combine_func_t f_combine)
Definition: enumerable_thread_specific.h:1077

References tbb::interface6::enumerable_thread_specific< T, Allocator, ETS_key_type >::combine(), and tbb::combinable< T >::my_ets.

Here is the call graph for this function:

## combine_each()

template<typename T >
template<typename combine_func_t >

void tbb::combinable< T >::combine_each | ( | combine_func_t | f_combine | ) |

inline

Definition at line 80 of file combinable.h.

{ my_ets.combine_each(f_combine); }
tbb::interface6::enumerable_thread_specific::combine_each
void combine_each(combine_func_t f_combine)
Definition: enumerable_thread_specific.h:1092

References tbb::interface6::enumerable_thread_specific< T, Allocator, ETS_key_type >::combine_each(), and tbb::combinable< T >::my_ets.

Here is the call graph for this function:

## local() [1/2]

template<typename T >

T& tbb::combinable< T >::local | ( |  | ) |

inline

Definition at line 70 of file combinable.h.

{ return my_ets.local(); }
tbb::interface6::enumerable_thread_specific::local
reference local()
returns reference to local, discarding exists
Definition: enumerable_thread_specific.h:928

References tbb::interface6::enumerable_thread_specific< T, Allocator, ETS_key_type >::local(), and tbb::combinable< T >::my_ets.

Here is the call graph for this function:

## local() [2/2]

template<typename T >

T& tbb::combinable< T >::local | ( | bool & | exists | ) |

inline

Definition at line 72 of file combinable.h.

{ return my_ets.local(exists); }

References tbb::interface6::enumerable_thread_specific< T, Allocator, ETS_key_type >::local(), and tbb::combinable< T >::my_ets.

Here is the call graph for this function:

## operator=() [1/2]

template<typename T >

combinable& tbb::combinable< T >::operator= | ( | combinable< T > && | other | ) |

inline

Definition at line 62 of file combinable.h.

{
my_ets=std::move(other.my_ets);
return *this;
}

References tbb::move(), and tbb::combinable< T >::my_ets.

Here is the call graph for this function:

## operator=() [2/2]

template<typename T >

combinable& tbb::combinable< T >::operator= | ( | const combinable< T > & | other | ) |

inline

Definition at line 56 of file combinable.h.

{
my_ets = other.my_ets;
return *this;
}

References tbb::combinable< T >::my_ets.

## Member Data Documentation

## my_ets

template<typename T >

my_ets_type tbb::combinable< T >::my_ets

private

Definition at line 38 of file combinable.h.

Referenced by tbb::combinable< T >::clear(), tbb::combinable< T >::combine(), tbb::combinable< T >::combine_each(), tbb::combinable< T >::local(), and tbb::combinable< T >::operator=().

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

- combinable.h

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.