- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Classes | Public Types | Public Member Functions | Friends | List of all members
tbb::interface6::enumerable_thread_specific< T, Allocator, ETS_key_type > Class Template Reference
Containers

The enumerable_thread_specific container. More...

`#include <enumerable_thread_specific.h>`

Inheritance diagram for tbb::interface6::enumerable_thread_specific< T, Allocator, ETS_key_type >:

## Public Types
typedef Allocator | allocator_type
| Basic types.
typedef T | value_type
typedef T & | reference
typedef const T & | const_reference
typedef T * | pointer
typedef const T * | const_pointer
typedef internal_collection_type::size_type | size_type
typedef internal_collection_type::difference_type | difference_type
typedef internal::enumerable_thread_specific_iterator < internal_collection_type, value_type > | iterator
typedef internal::enumerable_thread_specific_iterator < internal_collection_type, const value_type > | const_iterator
typedef generic_range_type < iterator > | range_type
typedef generic_range_type < const_iterator > | const_range_type

## Public Member Functions
| enumerable_thread_specific ()
| Default constructor. Each local instance of T is default constructed.
template<typename Finit >
| enumerable_thread_specific (Finit finit)
| Constructor with initializer functor. Each local instance of T is constructed by T(finit()).
| enumerable_thread_specific (const T &exemplar)
| Constructor with exemplar. Each local instance of T is copied-constructed from the exemplar.
| ~enumerable_thread_specific ()
| Destructor.
reference | local ()
| returns reference to local, discarding exists
reference | local (bool &exists)
| Returns reference to calling thread's local copy, creating one if necessary.
size_type | size () const
| Get the number of local copies.
bool | empty () const
| true if there have been no local copies created
iterator | begin ()
| begin iterator
iterator | end ()
| end iterator
const_iterator | begin () const
| begin const iterator
const_iterator | end () const
| end const iterator
range_type | range (size_t grainsize=1)
| Get range for parallel algorithms.
const_range_type | range (size_t grainsize=1) const
| Get const range for parallel algorithms.
void | clear ()
| Destroys local copies.
template<typename U , typename Alloc , ets_key_usage_type Cachetype>
| enumerable_thread_specific (const enumerable_thread_specific< U, Alloc, Cachetype > &other)
| enumerable_thread_specific (const enumerable_thread_specific &other)
enumerable_thread_specific & | operator= (const enumerable_thread_specific &other)
template<typename U , typename Alloc , ets_key_usage_type Cachetype>
enumerable_thread_specific & | operator= (const enumerable_thread_specific< U, Alloc, Cachetype > &other)
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)

## Friends
template<typename U , typename A , ets_key_usage_type C>
class | enumerable_thread_specific

## Detailed Description

### template<typename T, typename Allocator = cache_aligned_allocator<T>, ets_key_usage_type ETS_key_type = ets_no_key>
class tbb::interface6::enumerable_thread_specific< T, Allocator, ETS_key_type >

The enumerable_thread_specific container.

    enumerable_thread_specific has the following properties:
    - thread-local copies are lazily created, with default, exemplar or function initialization.
    - thread-local copies do not move (during lifetime, and excepting clear()) so the address of a copy is invariant.
    - the contained objects need not have operator=() defined if combine is not used.
    - enumerable_thread_specific containers may be copy-constructed or assigned.
    - thread-local copies can be managed by hash-table, or can be accessed via TLS storage for speed.
    - outside of parallel contexts, the contents of all thread-local copies are accessible by iterator or using combine or combine_each methods

Segmented iterator
  When the thread-local objects are containers with input_iterators defined, a segmented iterator may be used to iterate over all the elements of all thread-local copies.

combine and combine_each
  - Both methods are defined for enumerable_thread_specific.
  - combine() requires the the type T have operator=() defined.
  - neither method modifies the contents of the object (though there is no guarantee that the applied methods do not modify the object.)
  - Both are evaluated in serial context (the methods are assumed to be non-benign.)

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

- enumerable_thread_specific.h

Copyright © 2005-2014 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.