ITK  4.3.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< class TIterator >
28 
36 template< class 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 
103 template< class TIterator >
105  : public ThreadedDomainPartitioner< ThreadedIteratorRangePartitionerDomain< TIterator > >
106 {
107 public:
113 
115  itkNewMacro(Self);
116 
119 
121  typedef typename Superclass::DomainType DomainType;
122 
123  typedef TIterator IteratorType;
124 
131  virtual
132  ThreadIdType PartitionDomain(const ThreadIdType i,
133  const ThreadIdType requestedTotal,
134  const DomainType& completeDomain,
135  DomainType& subdomain) const;
136 
137 protected:
140 
141 private:
142  ThreadedIteratorRangePartitioner(const Self&); //purposely not implemented
143  void operator=(const Self&); //purposely not implemented
144 
145 };
146 
147 } // end namespace itk
148 
149 #ifndef ITK_MANUAL_INSTANTIATION
150 #include "itkThreadedIteratorRangePartitioner.hxx"
151 #endif
152 
153 #endif
154