Reference documentation for deal.II version Git 11de1224af 2020-11-24 16:17:24 -0500
\(\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 - 2019 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
32 template <typename Iterator>
34 #endif
35 
36 
127 template <typename Iterator>
129 {
130 public:
135 
136 
140  using iterator = Iterator;
141 
147  IteratorRange();
148 
156  IteratorRange(const iterator begin, const iterator end);
157 
162  begin();
163 
168  begin() const;
169 
175  end() const;
176 
182  end();
183 
184 private:
190 };
191 
192 
193 
198 template <typename Iterator>
200 {
201 public:
206  using BaseIterator = Iterator;
207 
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 
278 private:
283 };
284 
285 
286 
291 template <typename BaseIterator>
294  const typename identity<BaseIterator>::type &end)
295 {
296  IteratorRange<BaseIterator> ir(begin, end);
297  return ir;
298 }
299 
300 
301 // ------------------- template member functions
302 
303 
304 template <typename Iterator>
306  const BaseIterator &iterator)
307  : element_of_iterator_collection(iterator)
308 {}
309 
310 
311 
312 template <typename Iterator>
313 inline const typename IteratorOverIterators<Iterator>::BaseIterator &
315 {
317 }
318 
319 
320 
321 template <typename Iterator>
322 inline const typename IteratorOverIterators<Iterator>::BaseIterator *
324 {
326 }
327 
328 
329 
330 template <typename Iterator>
333 {
335  return *this;
336 }
337 
338 
339 
340 template <typename Iterator>
343 {
344  const IteratorOverIterators old_value = *this;
346  return *old_value;
347 }
348 
349 
350 
351 template <typename Iterator>
352 inline bool
355 {
357 }
358 
359 
360 
361 template <typename Iterator>
363 {
365 }
366 
367 
368 
369 template <typename Iterator>
371  : it_begin()
372  , it_end()
373 {}
374 
375 
376 
377 template <typename Iterator>
379  const iterator e)
380  : it_begin(b)
381  , it_end(e)
382 {}
383 
384 
385 template <typename Iterator>
388 {
389  return it_begin;
390 }
391 
392 
393 template <typename Iterator>
396 {
397  return it_begin;
398 }
399 
400 
401 template <typename Iterator>
404 {
405  return it_end;
406 }
407 
408 
409 template <typename Iterator>
412 {
413  return it_end;
414 }
415 
416 
418 
419 #endif
IteratorRange< BaseIterator > make_iterator_range(const BaseIterator &begin, const typename identity< BaseIterator >::type &end)
std::forward_iterator_tag iterator_category
IteratorOverIterators begin()
const BaseIterator & operator*() const
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
bool operator!=(const AlignedVector< T > &lhs, const AlignedVector< T > &rhs)
const IteratorOverIterators it_begin
Iterator iterator
IteratorOverIterators & operator++()
const BaseIterator * operator->() const
typename Iterator::difference_type difference_type
bool operator!=(const IteratorOverIterators &i_o_i) const
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:372
SynchronousIterators< Iterators > operator++(SynchronousIterators< Iterators > &a)
SymmetricTensor< 2, dim, Number > b(const Tensor< 2, dim, Number > &F)
IteratorOverIterators(const BaseIterator &iterator)
BaseIterator element_of_iterator_collection
::IteratorOverIterators< Iterator > IteratorOverIterators
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:371
std::enable_if< std::is_floating_point< T >::value &&std::is_floating_point< U >::value, typename ProductType< std::complex< T >, std::complex< U > >::type >::type operator*(const std::complex< T > &left, const std::complex< U > &right)
const IteratorOverIterators it_end
IteratorOverIterators end() const