16#ifndef vtkSMPThreadLocalAPI_h
17#define vtkSMPThreadLocalAPI_h
28#if VTK_SMP_ENABLE_SEQUENTIAL
31#if VTK_SMP_ENABLE_STDTHREAD
37#if VTK_SMP_ENABLE_OPENMP
51#if VTK_SMP_ENABLE_SEQUENTIAL
54#if VTK_SMP_ENABLE_STDTHREAD
60#if VTK_SMP_ENABLE_OPENMP
70#if VTK_SMP_ENABLE_SEQUENTIAL
72 std::unique_ptr<ThreadLocalSequential>(
new ThreadLocalSequential());
74#if VTK_SMP_ENABLE_STDTHREAD
76 std::unique_ptr<ThreadLocalSTDThread>(
new ThreadLocalSTDThread());
80 std::unique_ptr<ThreadLocalTBB>(
new ThreadLocalTBB());
82#if VTK_SMP_ENABLE_OPENMP
84 std::unique_ptr<ThreadLocalOpenMP>(
new ThreadLocalOpenMP());
92#if VTK_SMP_ENABLE_SEQUENTIAL
94 std::unique_ptr<ThreadLocalSequential>(
new ThreadLocalSequential(exemplar));
96#if VTK_SMP_ENABLE_STDTHREAD
98 std::unique_ptr<ThreadLocalSTDThread>(
new ThreadLocalSTDThread(exemplar));
100#if VTK_SMP_ENABLE_TBB
102 std::unique_ptr<ThreadLocalTBB>(
new ThreadLocalTBB(exemplar));
104#if VTK_SMP_ENABLE_OPENMP
106 std::unique_ptr<ThreadLocalOpenMP>(
new ThreadLocalOpenMP(exemplar));
113 BackendType backendType = this->GetSMPBackendType();
114 return this->BackendsImpl[
static_cast<int>(backendType)]->
Local();
120 BackendType backendType = this->GetSMPBackendType();
121 return this->BackendsImpl[
static_cast<int>(backendType)]->
size();
125 class iterator :
public std::iterator<std::forward_iterator_tag, T>
131 : ImplAbstract(other.ImplAbstract->Clone())
139 this->ImplAbstract = other.ImplAbstract->Clone();
146 this->ImplAbstract->Increment();
153 this->ImplAbstract->Increment();
159 return this->ImplAbstract->Compare(other.ImplAbstract.get());
164 return !this->ImplAbstract->Compare(other.ImplAbstract.get());
167 T&
operator*() {
return this->ImplAbstract->GetContent(); }
169 T*
operator->() {
return this->ImplAbstract->GetContentPtr(); }
172 std::unique_ptr<ItImplAbstract> ImplAbstract;
180 BackendType backendType = this->GetSMPBackendType();
182 iter.ImplAbstract = this->BackendsImpl[
static_cast<int>(backendType)]->
begin();
189 BackendType backendType = this->GetSMPBackendType();
191 iter.ImplAbstract = this->BackendsImpl[
static_cast<int>(backendType)]->
end();
207 return SMPToolsAPI.GetBackendType();
bool operator!=(const iterator &other)
iterator & operator=(const iterator &other)
iterator(const iterator &other)
bool operator==(const iterator &other)
vtkSMPThreadLocalAPI & operator=(const vtkSMPThreadLocalAPI &)=delete
vtkSMPThreadLocalAPI(const vtkSMPThreadLocalAPI &)=delete
vtkSMPThreadLocalAPI(const T &exemplar)
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.