VPTissue Reference Manual
CircularIterator.h
Go to the documentation of this file.
1 #ifndef CONTAINER_CIRCULAR_ITERATOR_H_
2 #define CONTAINER_CIRCULAR_ITERATOR_H_
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
22 #include "CircularIteratorImpl.h"
23 
24 #include <iterator>
25 
26 namespace SimPT_Sim {
27 namespace Container {
28 
33  template<typename T>
35 
42 template<typename T>
44 {
45  return CircularIterator<typename T::iterator>(std::begin(c),
46  std::end(c), std::begin(c));
47 }
48 
55 template<typename T>
57 {
58  return CircularIterator<typename T::iterator>(std::begin(c),
59  std::end(c), i);
60 }
61 
69 template<typename T>
71 {
72  return CircularIterator<T>(b, e, i);
73 }
74 
81 template<typename T>
83 {
84  return CircularIterator<T>(b, e, b);
85 }
86 
93 template<typename T>
95 {
96  CircularIterator<T> tmp(i);
97  return ++tmp;
98 }
99 
106 template<typename T>
108 {
109  CircularIterator<T> tmp(i);
110  return --tmp;
111 }
112 
113 } // namespace
114 } // namespace
115 
116 #endif // end-of-include-guard
Implementation of a circular iterator.
CircularIterator< typename T::iterator > make_circular(T &c)
Helper produces non-const circular iterator whose range corresponds to the begin and end iterators of...
Namespace for the core simulator.
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...
CircularIterator< T > prev(CircularIterator< T > i)
Helper yields the position the iterator would have if moved backward (in circular fashion) by 1 posit...