VTK: Common/Core/SMP/Common/vtkSMPThreadLocalImplAbstract.h Source File

| VTK 9.3.1

vtkSMPThreadLocalImplAbstract.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3
4 #ifndef vtkSMPThreadLocalImplAbstract_h
5 #define vtkSMPThreadLocalImplAbstract_h
6
7 #include <memory>
8
9 #include "SMP/Common/vtkSMPToolsImpl.h"
10
11 namespace vtk
12 {
13 namespace detail
14 {
15 namespace smp
16 {
17 VTK_ABI_NAMESPACE_BEGIN
18
19 template <typename T>
20 class vtkSMPThreadLocalImplAbstract
21 {
22 public:
23 virtual ~vtkSMPThreadLocalImplAbstract() = default;
24
25 virtual T& Local() = 0;
26
27 virtual size_t size() const = 0;
28
29 class ItImpl
30 {
31 public:
32 ItImpl() = default;
33 virtual ~ItImpl() = default;
34 ItImpl(const ItImpl&) = default;
35 ItImpl(ItImpl&&) noexcept = default;
36 ItImpl& operator=(const ItImpl&) = default;
37 ItImpl& operator=(ItImpl&&) noexcept = default;
38
39 virtual void Increment() = 0;
40
41 virtual bool Compare(ItImpl* other) = 0;
42
43 virtual T& GetContent() = 0;
44
45 virtual T* GetContentPtr() = 0;
46
47 std::unique_ptr<ItImpl> Clone() const { return std::unique_ptr<ItImpl>(CloneImpl()); }
48
49 protected:
50 virtual ItImpl* CloneImpl() const = 0;
51 };
52
53 virtual std::unique_ptr<ItImpl> begin() = 0;
54
55 virtual std::unique_ptr<ItImpl> end() = 0;
56 };
57
58 template <BackendType Backend, typename T>
59 class vtkSMPThreadLocalImpl : public vtkSMPThreadLocalImplAbstract<T>
60 {
61 };
62
63 VTK_ABI_NAMESPACE_END
64 } // namespace smp
65 } // namespace detail
66 } // namespace vtk
67
68 #endif
69 /* VTK-HeaderTest-Exclude: vtkSMPThreadLocalImplAbstract.h */
vtk::detail::smp::vtkSMPThreadLocalImplAbstract::ItImpl
Definition: vtkSMPThreadLocalImplAbstract.h:30
vtk::detail::smp::vtkSMPThreadLocalImplAbstract::ItImpl::Increment
virtual void Increment()=0
vtk::detail::smp::vtkSMPThreadLocalImplAbstract::ItImpl::ItImpl
ItImpl()=default
vtk::detail::smp::vtkSMPThreadLocalImplAbstract::ItImpl::GetContent
virtual T & GetContent()=0
vtk::detail::smp::vtkSMPThreadLocalImplAbstract::ItImpl::CloneImpl
virtual ItImpl * CloneImpl() const =0
vtk::detail::smp::vtkSMPThreadLocalImplAbstract::ItImpl::GetContentPtr
virtual T * GetContentPtr()=0
vtk::detail::smp::vtkSMPThreadLocalImplAbstract::ItImpl::ItImpl
ItImpl(const ItImpl &)=default
vtk::detail::smp::vtkSMPThreadLocalImplAbstract::ItImpl::Compare
virtual bool Compare(ItImpl *other)=0
vtk::detail::smp::vtkSMPThreadLocalImplAbstract::ItImpl::Clone
std::unique_ptr< ItImpl > Clone() const
Definition: vtkSMPThreadLocalImplAbstract.h:47
vtk::detail::smp::vtkSMPThreadLocalImplAbstract::ItImpl::~ItImpl
virtual ~ItImpl()=default
vtk::detail::smp::vtkSMPThreadLocalImplAbstract::ItImpl::ItImpl
ItImpl(ItImpl &&) noexcept=default
vtk::detail::smp::vtkSMPThreadLocalImplAbstract
Definition: vtkSMPThreadLocalImplAbstract.h:21
vtk::detail::smp::vtkSMPThreadLocalImplAbstract::Local
virtual T & Local()=0
vtk::detail::smp::vtkSMPThreadLocalImplAbstract::~vtkSMPThreadLocalImplAbstract
virtual ~vtkSMPThreadLocalImplAbstract()=default
vtk::detail::smp::vtkSMPThreadLocalImplAbstract::end
virtual std::unique_ptr< ItImpl > end()=0
vtk::detail::smp::vtkSMPThreadLocalImplAbstract::size
virtual size_t size() const =0
vtk::detail::smp::vtkSMPThreadLocalImplAbstract::begin
virtual std::unique_ptr< ItImpl > begin()=0
vtk::detail::smp::vtkSMPThreadLocalImpl
Definition: vtkSMPThreadLocalImplAbstract.h:60
detail
Definition: vtkCellTreeLocator.h:59
std
Definition: vtkSmartPointer.h:310
vtk
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.
Definition: vtkSMPThreadLocalAPI.h:30
vtkSMPToolsImpl.h