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
58#if VTK_SMP_ENABLE_SEQUENTIAL
60 std::make_unique<ThreadLocalSequential>();
62#if VTK_SMP_ENABLE_STDTHREAD
64 std::make_unique<ThreadLocalSTDThread>();
67 this->BackendsImpl[
static_cast<int>(
BackendType::TBB)] = std::make_unique<ThreadLocalTBB>();
69#if VTK_SMP_ENABLE_OPENMP
71 std::make_unique<ThreadLocalOpenMP>();
78#if VTK_SMP_ENABLE_SEQUENTIAL
80 std::make_unique<ThreadLocalSequential>(exemplar);
82#if VTK_SMP_ENABLE_STDTHREAD
84 std::make_unique<ThreadLocalSTDThread>(exemplar);
88 std::make_unique<ThreadLocalTBB>(exemplar);
90#if VTK_SMP_ENABLE_OPENMP
92 std::make_unique<ThreadLocalOpenMP>(exemplar);
99 BackendType backendType = this->GetSMPBackendType();
100 return this->BackendsImpl[
static_cast<int>(backendType)]->
Local();
106 BackendType backendType = this->GetSMPBackendType();
107 return this->BackendsImpl[
static_cast<int>(backendType)]->
size();
123 : ImplAbstract(other.ImplAbstract->Clone())
131 this->ImplAbstract = other.ImplAbstract->Clone();
138 this->ImplAbstract->Increment();
145 this->ImplAbstract->Increment();
151 return this->ImplAbstract->Compare(other.ImplAbstract.get());
156 return !this->ImplAbstract->Compare(other.ImplAbstract.get());
159 T&
operator*() {
return this->ImplAbstract->GetContent(); }
161 T*
operator->() {
return this->ImplAbstract->GetContentPtr(); }
164 std::unique_ptr<ItImplAbstract> ImplAbstract;
172 BackendType backendType = this->GetSMPBackendType();
174 iter.ImplAbstract = this->BackendsImpl[
static_cast<int>(backendType)]->
begin();
181 BackendType backendType = this->GetSMPBackendType();
183 iter.ImplAbstract = this->BackendsImpl[
static_cast<int>(backendType)]->
end();
199 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.