Gobelijn API documentation  - generated for commit a0cbea7
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
CircularIterator.h
Go to the documentation of this file.
1 #pragma once
2 /*
3  * This file is part of the gobelijn software.
4  * Gobelijn is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation, either version 3 of the License, or any later
7  * version. Gobelijn is distributed in the hope that it will be useful, but
8  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
9  * or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for details. You should have received
11  * a copy of the GNU General Public License along with the software. If not,
12  * see <http://www.gnu.org/licenses/>.
13  *
14  * Copyright 2012, Jan Broeckhove, CoMP research group, Universiteit Antwerpen.
15  */
21 #include <iterator>
22 
23 #include "CircularIteratorImpl.h"
24 
25 namespace UA_CoMP {
26 namespace Container {
27 
32 template <typename T>
34 
41 template <typename T>
43 {
44  return CircularIterator<typename T::iterator>(std::begin(c), std::end(c), std::begin(c));
45 }
46 
53 template <typename T>
55 {
56  return CircularIterator<typename T::iterator>(std::begin(c), std::end(c), i);
57 }
58 
66 template <typename T>
68 {
69  return CircularIterator<T>(b, e, i);
70 }
71 
78 template <typename T>
80 {
81  return CircularIterator<T>(b, e, b);
82 }
83 
90 template <typename T>
92 {
93  CircularIterator<T> tmp(i);
94  return ++tmp;
95 }
96 
103 template <typename T>
105 {
106  CircularIterator<T> tmp(i);
107  return --tmp;
108 }
109 } // namespace Container
110 } // namespace UA_CoMP
CircularIterator< T > prev(CircularIterator< T > i)
Helper yields the position the iterator would have if moved backward (in circular fashion) by 1 posit...
CircularIterator< typename T::iterator > make_circular(T &c)
Helper produces non-const circular iterator whose range corresponds to the begin and end iterators of...
Implementation of a circular iterator.
Circular iterator implementation.
CircularIterator< T > next(CircularIterator< T > i)
Helper yields the position the iterator would have if moved forward (in circular fashion) by 1 positi...