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
58 #if VTK_SMP_ENABLE_SEQUENTIAL
60 std::make_unique<ThreadLocalSequential>();
62 #if VTK_SMP_ENABLE_STDTHREAD
64 std::make_unique<ThreadLocalSTDThread>();
66 #if VTK_SMP_ENABLE_TBB
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);
86 #if VTK_SMP_ENABLE_TBB
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();
203 VTK_ABI_NAMESPACE_END
vtkSMPThreadLocalAPI & operator=(const vtkSMPThreadLocalAPI &)=delete
bool operator==(const iterator &other) const
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.
iterator(const iterator &other)
vtkSMPThreadLocalAPI(const T &exemplar)
std::forward_iterator_tag iterator_category
std::ptrdiff_t difference_type
iterator & operator=(const iterator &other)
bool operator!=(const iterator &other) const