ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkThreadedIteratorRangePartitioner.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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  * http://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 #ifndef __itkThreadedIteratorRangePartitioner_h
19 #define __itkThreadedIteratorRangePartitioner_h
20 
22 
23 namespace itk
24 {
25 
26 template< typename TIterator >
28 
36 template< typename TIterator >
38 {
39 public:
40  typedef TIterator IteratorType;
42 
44 
46  {
47  this->m_Begin = begin;
48  this->m_End = end;
49  }
50 
52  {
53  this->m_Begin = rhs.m_Begin;
54  this->m_End = rhs.m_End;
55  }
56 
57  void operator=( const Self & rhs )
58  {
59  if ( this == & rhs )
60  {
61  return;
62  }
63  this->m_Begin = rhs.m_Begin;
64  this->m_End = rhs.m_End;
65  }
66 
67  const IteratorType & Begin() const
68  {
69  return this->m_Begin;
70  }
71  const IteratorType & End() const
72  {
73  return this->m_End;
74  }
75 
76 private:
80 };
81 
106 template< typename TIterator >
108  : public ThreadedDomainPartitioner< ThreadedIteratorRangePartitionerDomain< TIterator > >
109 {
110 public:
116 
118  itkNewMacro(Self);
119 
122 
124  typedef typename Superclass::DomainType DomainType;
125 
126  typedef TIterator IteratorType;
127 
139  virtual
141  const ThreadIdType requestedTotal,
142  const DomainType& completeDomain,
143  DomainType& subDomain) const;
144 
145 protected:
148 
149 private:
150  ThreadedIteratorRangePartitioner(const Self&); //purposely not implemented
151  void operator=(const Self&); //purposely not implemented
152 
153 };
154 
155 } // end namespace itk
156 
157 #ifndef ITK_MANUAL_INSTANTIATION
158 #include "itkThreadedIteratorRangePartitioner.hxx"
159 #endif
160 
161 #endif
Light weight base class for most itk classes.
Virtual base class for partitioning a domain into subsets to be processed per thread when parallel pr...
ThreadedIteratorRangePartitionerDomain(const IteratorType &begin, const IteratorType &end)
ThreadedDomainPartitioner< ThreadedIteratorRangePartitionerDomain< TIterator > > Superclass
Partitions an iterator range for threading.
virtual ThreadIdType PartitionDomain(const ThreadIdType threadId, const ThreadIdType requestedTotal, const DomainType &completeDomain, DomainType &subDomain) const
Domain type for the ThreadedIteratorRangePartitioner.
unsigned int ThreadIdType
Definition: itkIntTypes.h:159