4 #ifndef vtkSMPThreadLocalAPI_h
5 #define vtkSMPThreadLocalAPI_h
16 #if VTK_SMP_ENABLE_SEQUENTIAL
19 #if VTK_SMP_ENABLE_STDTHREAD
22 #if VTK_SMP_ENABLE_TBB
25 #if VTK_SMP_ENABLE_OPENMP
35 VTK_ABI_NAMESPACE_BEGIN
40 #if VTK_SMP_ENABLE_SEQUENTIAL
43 #if VTK_SMP_ENABLE_STDTHREAD
46 #if VTK_SMP_ENABLE_TBB
49 #if VTK_SMP_ENABLE_OPENMP
59 #if VTK_SMP_ENABLE_SEQUENTIAL
61 std::unique_ptr<ThreadLocalSequential>(
new ThreadLocalSequential());
63 #if VTK_SMP_ENABLE_STDTHREAD
65 std::unique_ptr<ThreadLocalSTDThread>(
new ThreadLocalSTDThread());
67 #if VTK_SMP_ENABLE_TBB
69 std::unique_ptr<ThreadLocalTBB>(
new ThreadLocalTBB());
71 #if VTK_SMP_ENABLE_OPENMP
73 std::unique_ptr<ThreadLocalOpenMP>(
new ThreadLocalOpenMP());
81 #if VTK_SMP_ENABLE_SEQUENTIAL
83 std::unique_ptr<ThreadLocalSequential>(
new ThreadLocalSequential(exemplar));
85 #if VTK_SMP_ENABLE_STDTHREAD
87 std::unique_ptr<ThreadLocalSTDThread>(
new ThreadLocalSTDThread(exemplar));
89 #if VTK_SMP_ENABLE_TBB
91 std::unique_ptr<ThreadLocalTBB>(
new ThreadLocalTBB(exemplar));
93 #if VTK_SMP_ENABLE_OPENMP
95 std::unique_ptr<ThreadLocalOpenMP>(
new ThreadLocalOpenMP(exemplar));
102 BackendType backendType = this->GetSMPBackendType();
103 return this->BackendsImpl[
static_cast<int>(backendType)]->
Local();
109 BackendType backendType = this->GetSMPBackendType();
110 return this->BackendsImpl[
static_cast<int>(backendType)]->
size();
126 : ImplAbstract(other.ImplAbstract->Clone())
134 this->ImplAbstract = other.ImplAbstract->Clone();
141 this->ImplAbstract->Increment();
148 this->ImplAbstract->Increment();
154 return this->ImplAbstract->Compare(other.ImplAbstract.get());
159 return !this->ImplAbstract->Compare(other.ImplAbstract.get());
162 T&
operator*() {
return this->ImplAbstract->GetContent(); }
164 T*
operator->() {
return this->ImplAbstract->GetContentPtr(); }
167 std::unique_ptr<ItImplAbstract> ImplAbstract;
175 BackendType backendType = this->GetSMPBackendType();
177 iter.ImplAbstract = this->BackendsImpl[
static_cast<int>(backendType)]->
begin();
184 BackendType backendType = this->GetSMPBackendType();
186 iter.ImplAbstract = this->BackendsImpl[
static_cast<int>(backendType)]->
end();
202 return SMPToolsAPI.GetBackendType();
206 VTK_ABI_NAMESPACE_END
bool operator!=(const iterator &other)
std::ptrdiff_t difference_type
iterator(const iterator &other)
iterator & operator=(const iterator &other)
bool operator==(const iterator &other)
std::forward_iterator_tag iterator_category
vtkSMPThreadLocalAPI & operator=(const vtkSMPThreadLocalAPI &)=delete
vtkSMPThreadLocalAPI(const vtkSMPThreadLocalAPI &)=delete
vtkSMPThreadLocalAPI(const T &exemplar)
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.