go home Home | Main Page | Topics | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkVectorDataContainer.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright UMC Utrecht and contributors
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
22/*=========================================================================
23
24 Program: Insight Segmentation & Registration Toolkit
25 Module: $RCSfile$
26 Date: $Date: 2008-04-15 19:54:41 +0200 (Tue, 15 Apr 2008) $
27 Version: $Revision: 1573 $
28
29 Copyright (c) Insight Software Consortium. All rights reserved.
30 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
31
32 This software is distributed WITHOUT ANY WARRANTY; without even
33 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
34 PURPOSE. See the above copyright notices for more information.
35
36=========================================================================*/
37#ifndef itkVectorDataContainer_h
38#define itkVectorDataContainer_h
39
40#include "itkDataObject.h"
41#include "itkObjectFactory.h"
42#include "itkVectorContainer.h"
43
44#include <utility>
45#include <vector>
46
47namespace itk
48{
49
69template <typename TElement>
70class ITK_TEMPLATE_EXPORT VectorDataContainer
71 : public DataObject
72 , private std::vector<TElement>
73{
74public:
77 using Superclass = DataObject;
78 using Pointer = SmartPointer<Self>;
79 using ConstPointer = SmartPointer<const Self>;
80
82 using ElementIdentifier = SizeValueType;
83 using Element = TElement;
84
85private:
87 using VectorType = std::vector<Element>;
88 using size_type = typename VectorType::size_type;
89 using VectorIterator = typename VectorType::iterator;
90 using VectorConstIterator = typename VectorType::const_iterator;
91
92protected:
97 : DataObject()
98 , VectorType()
99 {}
101 : DataObject()
102 , VectorType(n)
103 {}
105 : DataObject()
106 , VectorType(n, x)
107 {}
109 : DataObject()
110 , VectorType(r)
111 {}
112 template <typename InputIterator>
113 VectorDataContainer(InputIterator first, InputIterator last)
114 : DataObject()
115 , VectorType(first, last)
116 {}
117
118public:
121
123 itkNewMacro(Self);
124
127
131 {
132 return *this;
133 }
134
135
137 const STLContainerType &
139 {
140 return *this;
141 }
142
143 using STLContainerType::begin;
144 using STLContainerType::end;
145 using STLContainerType::rbegin;
146 using STLContainerType::rend;
147 using STLContainerType::cbegin;
148 using STLContainerType::cend;
149 using STLContainerType::crbegin;
150 using STLContainerType::crend;
151
152 using STLContainerType::size;
153 using STLContainerType::max_size;
154 using STLContainerType::resize;
155 using STLContainerType::capacity;
156 using STLContainerType::empty;
157 using STLContainerType::reserve;
158 using STLContainerType::shrink_to_fit;
159
160 using STLContainerType::operator[];
161 using STLContainerType::at;
162 using STLContainerType::front;
163 using STLContainerType::back;
164
165 using STLContainerType::assign;
166 using STLContainerType::push_back;
167 using STLContainerType::pop_back;
168 using STLContainerType::insert;
169 using STLContainerType::erase;
170 using STLContainerType::swap;
171 using STLContainerType::clear;
172
173 using STLContainerType::get_allocator;
174
175 using typename STLContainerType::reference;
176 using typename STLContainerType::const_reference;
177 using typename STLContainerType::iterator;
178 using typename STLContainerType::const_iterator;
179 // already declared before
180 // using STLContainerType::size_type;
181 using typename STLContainerType::difference_type;
182 using typename STLContainerType::value_type;
183 using typename STLContainerType::allocator_type;
184 using typename STLContainerType::pointer;
185 using typename STLContainerType::const_pointer;
186 using typename STLContainerType::reverse_iterator;
187 using typename STLContainerType::const_reverse_iterator;
188
189 using Iterator = typename VectorContainer<ElementIdentifier, TElement>::Iterator;
190 using ConstIterator = typename VectorContainer<ElementIdentifier, TElement>::ConstIterator;
191
192 /* Declare the public interface routines. */
193
203
211
221
227
233
240
246
252 bool
254
261
268
273 Begin() const;
274
279 End() const;
280
286
292
296 SizeValueType
297 Size() const;
298
309
316 void
318
322 void
323 Initialize() override;
324};
325
326} // end namespace itk
327
328#ifndef ITK_MANUAL_INSTANTIATION
329# include "itkVectorDataContainer.hxx"
330#endif
331
332#endif // end itkVectorDataContainer_h
Element & ElementAt(ElementIdentifier)
typename VectorContainer< ElementIdentifier, ImageSampleType >::Iterator Iterator
SizeValueType Size() const
Element GetElement(ElementIdentifier) const
void DeleteIndex(ElementIdentifier)
ConstIterator Begin() const
const STLContainerType & CastToSTLConstContainer() const
Element & CreateElementAt(ElementIdentifier)
void CreateIndex(ElementIdentifier)
const Element & ElementAt(ElementIdentifier) const
VectorDataContainer(size_type n, const Element &x)
itkOverrideGetNameOfClassMacro(VectorDataContainer)
void InsertElement(ElementIdentifier, Element)
void SetElement(ElementIdentifier, Element)
ConstIterator End() const
STLContainerType & CastToSTLContainer()
void Reserve(ElementIdentifier)
typename VectorType::const_iterator VectorConstIterator
void Initialize() override
VectorDataContainer(InputIterator first, InputIterator last)
bool IndexExists(ElementIdentifier) const
bool GetElementIfIndexExists(ElementIdentifier, Element *) const
typename VectorContainer< ElementIdentifier, ImageSampleType >::ConstIterator ConstIterator


Generated on 26-02-2026 for elastix by doxygen 1.16.1 (669aeeefca743c148e2d935b3d3c69535c7491e6) elastix logo