ITK  5.3.0
Insight Toolkit
itkDataObjectIterator.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  * 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 itkDataObjectIterator_h
19 #define itkDataObjectIterator_h
20 
21 #include "itkProcessObject.h"
22 
23 namespace itk
24 {
31 {
32 public:
34 
35  DataObjectIterator() = default;
36 
38  {
39  m_Iterator = iter.m_Iterator;
40  m_Begin = iter.m_Begin;
41  m_End = iter.m_End;
42  }
43 
46  {
47  if (this != &iter)
48  {
49  m_Iterator = iter.m_Iterator;
50  m_Begin = iter.m_Begin;
51  m_End = iter.m_End;
52  }
53  return *this;
54  }
55 
56  DataObject *
58  {
59  return m_Iterator->second;
60  }
61 
63  GetName() const
64  {
65  return m_Iterator->first;
66  }
67 
70  {
71  DataObjectIterator tmp = *this;
72  ++(*this);
73  return tmp;
74  }
75 
78  {
79  ++m_Iterator;
80  return *this;
81  }
82 
83  bool
84  operator==(const DataObjectIterator & iter) const
85  {
86  return m_Iterator == iter.m_Iterator && m_Begin == iter.m_Begin && m_End == iter.m_End;
87  }
88 
90 
91  void
93  {
95  }
96 
97  bool
98  IsAtEnd() const
99  {
100  return m_Iterator == m_End;
101  }
102 
103 protected:
104  using InternalIteratorType = ProcessObject::DataObjectPointerMap::iterator;
108 };
109 } // namespace itk
110 #endif
itk::DataObjectIterator::DataObjectIterator
DataObjectIterator()=default
itk::DataObjectIterator::operator++
DataObjectIterator operator++(int)
Definition: itkDataObjectIterator.h:69
itk::DataObjectIterator::InternalIteratorType
ProcessObject::DataObjectPointerMap::iterator InternalIteratorType
Definition: itkDataObjectIterator.h:104
itk::DataObjectIterator::m_Iterator
InternalIteratorType m_Iterator
Definition: itkDataObjectIterator.h:105
itk::DataObjectIterator
A forward iterator over the DataObject of a ProcessObject.
Definition: itkDataObjectIterator.h:30
itk::DataObjectIterator::operator==
bool operator==(const DataObjectIterator &iter) const
Definition: itkDataObjectIterator.h:84
itk::DataObjectIterator::DataObjectIdentifierType
DataObject::DataObjectIdentifierType DataObjectIdentifierType
Definition: itkDataObjectIterator.h:33
itk::DataObjectIterator::GetDataObject
DataObject * GetDataObject()
Definition: itkDataObjectIterator.h:57
itk::DataObjectIterator::m_Begin
InternalIteratorType m_Begin
Definition: itkDataObjectIterator.h:106
itkProcessObject.h
itk::DataObjectIterator::GetName
const DataObjectIdentifierType & GetName() const
Definition: itkDataObjectIterator.h:63
itk::DataObjectIterator::ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(DataObjectIterator)
itk::DataObject::DataObjectIdentifierType
std::string DataObjectIdentifierType
Definition: itkDataObject.h:304
itk::DataObjectIterator::GoToBegin
void GoToBegin()
Definition: itkDataObjectIterator.h:92
itk::DataObjectIterator::DataObjectIterator
DataObjectIterator(const DataObjectIterator &iter)
Definition: itkDataObjectIterator.h:37
itk::DataObjectIterator::IsAtEnd
bool IsAtEnd() const
Definition: itkDataObjectIterator.h:98
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::DataObjectIterator::operator=
DataObjectIterator & operator=(const DataObjectIterator &iter)
Definition: itkDataObjectIterator.h:45
itk::DataObjectIterator::m_End
InternalIteratorType m_End
Definition: itkDataObjectIterator.h:107
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293
itk::DataObjectIterator::operator++
DataObjectIterator & operator++()
Definition: itkDataObjectIterator.h:77