ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
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
37 DataObjectIterator(const DataObjectIterator & iter) = default;
38
41 {
42 if (this != &iter)
43 {
45 m_Begin = iter.m_Begin;
46 m_End = iter.m_End;
47 }
48 return *this;
49 }
50
53 {
54 return m_Iterator->second;
55 }
56
57 [[nodiscard]] const DataObjectIdentifierType &
58 GetName() const
59 {
60 return m_Iterator->first;
61 }
62
65 {
66 const DataObjectIterator tmp = *this;
67 ++(*this);
68 return tmp;
69 }
70
73 {
74 ++m_Iterator;
75 return *this;
76 }
77
78 bool
79 operator==(const DataObjectIterator & iter) const
80 {
81 return m_Iterator == iter.m_Iterator && m_Begin == iter.m_Begin && m_End == iter.m_End;
82 }
83
85
86 void
88 {
90 }
91
92 [[nodiscard]] bool
93 IsAtEnd() const
94 {
95 return m_Iterator == m_End;
96 }
97
98protected:
99 using InternalIteratorType = ProcessObject::DataObjectPointerMap::iterator;
103};
104} // namespace itk
105#endif
A forward iterator over the DataObject of a ProcessObject.
DataObjectIterator(const DataObjectIterator &iter)=default
const DataObjectIdentifierType & GetName() const
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)
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....