4#ifndef vtkSMPThreadLocalAPI_h
5#define vtkSMPThreadLocalAPI_h
16#if VTK_SMP_ENABLE_SEQUENTIAL
19#if VTK_SMP_ENABLE_STDTHREAD
25#if VTK_SMP_ENABLE_OPENMP
35VTK_ABI_NAMESPACE_BEGIN
40#if VTK_SMP_ENABLE_SEQUENTIAL
43#if VTK_SMP_ENABLE_STDTHREAD
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());
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));
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();
std::ptrdiff_t difference_type
iterator & operator=(const iterator &other)
iterator(const iterator &other)
bool operator==(const iterator &other) const
bool operator!=(const iterator &other) const
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.