ITK  6.0.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 * 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#ifndef itkDataObjectIterator_h
19#define itkDataObjectIterator_h
20
21#include "itkProcessObject.h"
22
23namespace itk
24{
31{
32public:
34
35 DataObjectIterator() = default;
36
38 {
40 m_Begin = iter.m_Begin;
41 m_End = iter.m_End;
42 }
43
46 {
47 if (this != &iter)
48 {
50 m_Begin = iter.m_Begin;
51 m_End = iter.m_End;
52 }
53 return *this;
54 }
55
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
103protected:
104 using InternalIteratorType = ProcessObject::DataObjectPointerMap::iterator;
108};
109} // namespace itk
110#endif
A forward iterator over the DataObject of a ProcessObject.
DataObjectIterator(const DataObjectIterator &iter)
const DataObjectIdentifierType & GetName() const
InternalIteratorType m_End
DataObjectIterator operator++(int)
ProcessObject::DataObjectPointerMap::iterator InternalIteratorType
bool operator==(const DataObjectIterator &iter) const
DataObjectIterator & operator=(const DataObjectIterator &iter)
InternalIteratorType m_Iterator
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(DataObjectIterator)
InternalIteratorType m_Begin
DataObjectIterator & operator++()
DataObject::DataObjectIdentifierType DataObjectIdentifierType
Base class for all data objects in ITK.
std::string DataObjectIdentifierType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....