VTK
9.1.0
Common
Core
vtkSMPThreadLocal.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkSMPThreadLocal.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
=========================================================================*/
81
#ifndef vtkSMPThreadLocal_h
82
#define vtkSMPThreadLocal_h
83
84
#include "
SMP/Common/vtkSMPThreadLocalAPI.h
"
85
86
template
<
typename
T>
87
class
vtkSMPThreadLocal
88
{
89
public
:
93
vtkSMPThreadLocal
()
94
: ThreadLocalAPI()
95
{
96
}
97
103
explicit
vtkSMPThreadLocal
(
const
T& exemplar)
104
: ThreadLocalAPI(exemplar)
105
{
106
}
107
116
T&
Local
() {
return
this->ThreadLocalAPI.Local(); }
117
121
size_t
size
() {
return
this->ThreadLocalAPI.size(); }
122
132
typedef
typename
vtk::detail::smp::vtkSMPThreadLocalAPI<T>::iterator
iterator
;
133
138
iterator
begin
() {
return
this->ThreadLocalAPI.begin(); };
139
144
iterator
end
() {
return
this->ThreadLocalAPI.end(); }
145
146
private
:
147
vtk::detail::smp::vtkSMPThreadLocalAPI<T>
ThreadLocalAPI;
148
149
// disable copying
150
vtkSMPThreadLocal
(
const
vtkSMPThreadLocal
&) =
delete
;
151
void
operator=(
const
vtkSMPThreadLocal
&) =
delete
;
152
};
153
154
#endif
155
// VTK-HeaderTest-Exclude: vtkSMPThreadLocal.h
vtkSMPThreadLocal::vtkSMPThreadLocal
vtkSMPThreadLocal(const T &exemplar)
Constructor that allows the specification of an exemplar object which is used when constructing objec...
Definition:
vtkSMPThreadLocal.h:103
vtkSMPThreadLocal::begin
iterator begin()
Returns a new iterator pointing to the beginning of the local storage container.
Definition:
vtkSMPThreadLocal.h:138
vtkSMPThreadLocal::Local
T & Local()
This needs to be called mainly within a threaded execution path.
Definition:
vtkSMPThreadLocal.h:116
vtkSMPThreadLocal::iterator
vtk::detail::smp::vtkSMPThreadLocalAPI< T >::iterator iterator
Subset of the standard iterator API.
Definition:
vtkSMPThreadLocal.h:132
vtkSMPThreadLocal
Thread local storage for VTK objects.
Definition:
vtkSMPThreadLocal.h:88
vtk::detail::smp::vtkSMPThreadLocalAPI::iterator
Definition:
vtkSMPThreadLocalAPI.h:126
vtkSMPThreadLocalAPI.h
vtkSMPThreadLocal::end
iterator end()
Returns a new iterator pointing to past the end of the local storage container.
Definition:
vtkSMPThreadLocal.h:144
vtkSMPThreadLocal::vtkSMPThreadLocal
vtkSMPThreadLocal()
Default constructor.
Definition:
vtkSMPThreadLocal.h:93
vtk::detail::smp::vtkSMPThreadLocalAPI
Definition:
vtkSMPThreadLocalAPI.h:50
vtkSMPThreadLocal::size
size_t size()
Return the number of thread local objects that have been initialized.
Definition:
vtkSMPThreadLocal.h:121
Generated on Fri Nov 5 2021 00:10:57 for VTK by
1.8.20