Reference documentation for deal.II version 9.3.3
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
iterator_range.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 2014 - 2020 by the deal.II authors
4//
5// This file is part of the deal.II library.
6//
7// The deal.II library is free software; you can use it, redistribute
8// it, and/or modify it under the terms of the GNU Lesser General
9// Public License as published by the Free Software Foundation; either
10// version 2.1 of the License, or (at your option) any later version.
11// The full text of the license can be found in the file LICENSE.md at
12// the top level directory of deal.II.
13//
14// ---------------------------------------------------------------------
15
16#ifndef dealii_iterator_range_h
17#define dealii_iterator_range_h
18
19
20#include <deal.II/base/config.h>
21
23
24#include <iterator>
25
26
28
29
30// Forward declaration
31#ifndef DOXYGEN
32template <typename Iterator>
34#endif
35
36
127template <typename Iterator>
129{
130public:
135
136
140 using iterator = Iterator;
141
148
157
162 begin();
163
168 begin() const;
169
175 end() const;
176
182 end();
183
184private:
190};
191
192
193
198template <typename Iterator>
200{
201public:
206 using BaseIterator = Iterator;
207
214 explicit IteratorOverIterators(const BaseIterator &iterator);
215
220 const BaseIterator &operator*() const;
221
226 const BaseIterator *operator->() const;
227
233 operator++();
234
241 operator++(int);
242
249 bool
250 operator!=(const IteratorOverIterators &i_o_i) const;
251
265 operator const BaseIterator &() const;
266
272 using iterator_category = std::forward_iterator_tag;
273 using value_type = Iterator;
274 using difference_type = typename Iterator::difference_type;
275 using pointer = Iterator *;
276 using reference = Iterator &;
277
278private:
283};
284
285
286
291template <typename BaseIterator>
294 const typename identity<BaseIterator>::type &end)
295{
297 return ir;
298}
299
300
301// ------------------- template member functions
302
303
304template <typename Iterator>
306 const BaseIterator &iterator)
307 : element_of_iterator_collection(iterator)
308{}
309
310
311
312template <typename Iterator>
315{
316 return element_of_iterator_collection;
317}
318
319
320
321template <typename Iterator>
324{
325 return &element_of_iterator_collection;
326}
327
328
329
330template <typename Iterator>
333{
334 ++element_of_iterator_collection;
335 return *this;
336}
337
338
339
340template <typename Iterator>
343{
344 const IteratorOverIterators old_value = *this;
345 ++element_of_iterator_collection;
346 return *old_value;
347}
348
349
350
351template <typename Iterator>
352inline bool
354operator!=(const IteratorOverIterators &i_o_i) const
355{
356 return element_of_iterator_collection != i_o_i.element_of_iterator_collection;
357}
358
359
360
361template <typename Iterator>
363{
364 return element_of_iterator_collection;
365}
366
367
368
369template <typename Iterator>
371 : it_begin()
372 , it_end()
373{}
374
375
376
377template <typename Iterator>
379 const iterator e)
380 : it_begin(b)
381 , it_end(e)
382{}
383
384
385template <typename Iterator>
388{
389 return it_begin;
390}
391
392
393template <typename Iterator>
396{
397 return it_begin;
398}
399
400
401template <typename Iterator>
404{
405 return it_end;
406}
407
408
409template <typename Iterator>
412{
413 return it_end;
414}
415
416
418
419#endif
typename Iterator::difference_type difference_type
IteratorOverIterators(const BaseIterator &iterator)
BaseIterator element_of_iterator_collection
const BaseIterator & operator*() const
IteratorOverIterators & operator++()
const BaseIterator * operator->() const
std::forward_iterator_tag iterator_category
bool operator!=(const IteratorOverIterators &i_o_i) const
IteratorOverIterators end() const
IteratorOverIterators begin()
::IteratorOverIterators< Iterator > IteratorOverIterators
const IteratorOverIterators it_begin
Iterator iterator
const IteratorOverIterators it_end
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:402
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:403
IteratorRange< BaseIterator > make_iterator_range(const BaseIterator &begin, const typename identity< BaseIterator >::type &end)
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
SymmetricTensor< 2, dim, Number > b(const Tensor< 2, dim, Number > &F)
VectorType::value_type * end(VectorType &V)
VectorType::value_type * begin(VectorType &V)