VTK  9.1.0
vtkSMPThreadLocalImplAbstract.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkSMPThreadLocalImplAbstract.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15
16#ifndef vtkSMPThreadLocalImplAbstract_h
17#define vtkSMPThreadLocalImplAbstract_h
18
19#include <memory>
20
22
23namespace vtk
24{
25namespace detail
26{
27namespace smp
28{
29
30template <typename T>
32{
33public:
34 virtual ~vtkSMPThreadLocalImplAbstract() = default;
35
36 virtual T& Local() = 0;
37
38 virtual size_t size() const = 0;
39
40 class ItImpl
41 {
42 public:
43 ItImpl() = default;
44 virtual ~ItImpl() = default;
45 ItImpl(const ItImpl&) = default;
46 ItImpl(ItImpl&&) = default;
47 ItImpl& operator=(const ItImpl&) = default;
48 ItImpl& operator=(ItImpl&&) = default;
49
50 virtual void Increment() = 0;
51
52 virtual bool Compare(ItImpl* other) = 0;
53
54 virtual T& GetContent() = 0;
55
56 virtual T* GetContentPtr() = 0;
57
58 std::unique_ptr<ItImpl> Clone() const { return std::unique_ptr<ItImpl>(CloneImpl()); }
59
60 protected:
61 virtual ItImpl* CloneImpl() const = 0;
62 };
63
64 virtual std::unique_ptr<ItImpl> begin() = 0;
65
66 virtual std::unique_ptr<ItImpl> end() = 0;
67};
68
69template <BackendType Backend, typename T>
71{
72};
73
74} // namespace smp
75} // namespace detail
76} // namespace vtk
77
78#endif
virtual std::unique_ptr< ItImpl > end()=0
virtual std::unique_ptr< ItImpl > begin()=0
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.