ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkPoolMultiThreader.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18/*=========================================================================
19 *
20 * Portions of this file are subject to the VTK Toolkit Version 3 copyright.
21 *
22 * Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
23 *
24 * For complete copyright, license and disclaimer of warranty information
25 * please refer to the NOTICE file at the top of the ITK source tree.
26 *
27 *=========================================================================*/
28#ifndef itkPoolMultiThreader_h
29#define itkPoolMultiThreader_h
30
32#include "itkThreadPool.h"
33
34namespace itk
35{
44
45class ITKCommon_EXPORT PoolMultiThreader : public MultiThreaderBase
46{
47public:
48 ITK_DISALLOW_COPY_AND_MOVE(PoolMultiThreader);
49
55
57 itkNewMacro(Self);
58
60 itkOverrideGetNameOfClassMacro(PoolMultiThreader);
61
62
67 void
69
74 void
75 SetSingleMethod(ThreadFunctionType, void * data) override;
76
79 void
81 SizeValueType lastIndexPlus1,
83 ProcessObject * filter) override;
84
86 void
87 ParallelizeImageRegion(unsigned int dimension,
88 const IndexValueType index[],
89 const SizeValueType size[],
91 ProcessObject * filter) override;
92
95 void
96 SetMaximumNumberOfThreads(ThreadIdType numberOfThreads) override;
97
99 {
100 std::future<ITK_THREAD_RETURN_TYPE> Future;
101 };
102
103protected:
106 void
107 PrintSelf(std::ostream & os, Indent indent) const override;
108
109private:
110 // Thread pool instance and factory
112
117
121 friend class ProcessObject;
122};
123
124} // end namespace itk
125#endif
Control indentation during Print() invocation.
Definition itkIndent.h:50
std::function< void(SizeValueType)> ArrayThreadingFunctorType
std::function< void(const IndexValueType index[], const SizeValueType size[])> ThreadingFunctorType
void PrintSelf(std::ostream &os, Indent indent) const override
ThreadPoolInfoStruct m_ThreadInfoArray[ITK_MAX_THREADS]
~PoolMultiThreader() override
void SingleMethodExecute() override
void SetSingleMethod(ThreadFunctionType, void *data) override
void SetMaximumNumberOfThreads(ThreadIdType numberOfThreads) override
void ParallelizeImageRegion(unsigned int dimension, const IndexValueType index[], const SizeValueType size[], ThreadingFunctorType funcP, ProcessObject *filter) override
SmartPointer< Self > Pointer
SmartPointer< const Self > ConstPointer
void ParallelizeArray(SizeValueType firstIndex, SizeValueType lastIndexPlus1, ArrayThreadingFunctorType aFunc, ProcessObject *filter) override
ThreadPool::Pointer m_ThreadPool
Implements transparent reference counting.
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned int ThreadIdType
unsigned long SizeValueType
Definition itkIntTypes.h:86
constexpr vcl_size_t ITK_MAX_THREADS
void(*)(void *) ThreadFunctionType
long IndexValueType
Definition itkIntTypes.h:93
std::future< ITK_THREAD_RETURN_TYPE > Future