1 #ifndef BALL_LINALG_BIDIRECTIONALITERATOR_H
2 #define BALL_LINALG_BIDIRECTIONALITERATOR_H
4 #ifndef BALL_LINALG_FORWARDITERATOR_H
18 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
19 class ConstBidirectionalIterator
20 :
public ConstForwardIterator<Container, DataType, Position, Traits>
138 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
141 if (Base::getTraits().isSingular())
143 Exception::SingularIterator e;
146 Base::getTraits().toBegin();
149 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
152 if (Base::getTraits().isSingular())
154 Exception::SingularIterator e;
157 Base::getTraits().toEnd();
160 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
163 if (Base::getTraits().isSingular())
165 Exception::SingularIterator e;
168 Base::getTraits().toRBegin();
171 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
174 if (Base::getTraits().isSingular())
176 Exception::SingularIterator e;
179 Base::getTraits().toREnd();
182 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
183 ConstBidirectionalIterator<Container, DataType, Position, Traits>&
186 if (!Base::getTraits().isValid())
188 Exception::InvalidIterator e;
191 Base::getTraits().forward();
195 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
196 ConstBidirectionalIterator<Container, DataType, Position, Traits>
199 if (!Base::getTraits().isValid())
201 Exception::InvalidIterator e;
204 ConstBidirectionalIterator iterator(*
this);
209 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
210 ConstBidirectionalIterator<Container, DataType, Position, Traits>&
213 if (Base::getTraits().isSingular())
215 Exception::SingularIterator e;
218 Base::getTraits().backward();
222 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
223 ConstBidirectionalIterator<Container, DataType, Position, Traits>
226 if (Base::getTraits().isSingular())
228 Exception::SingularIterator e;
231 ConstBidirectionalIterator iterator(*
this);
236 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
237 ConstBidirectionalIterator<Container, DataType, Position, Traits>
240 ConstBidirectionalIterator iterator(container);
245 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
246 ConstBidirectionalIterator<Container, DataType, Position, Traits>
249 ConstBidirectionalIterator iterator(container);
254 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
255 ConstBidirectionalIterator<Container, DataType, Position, Traits>
258 ConstBidirectionalIterator iterator(container);
263 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
264 ConstBidirectionalIterator<Container, DataType, Position, Traits>
267 ConstBidirectionalIterator iterator(container);
273 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
274 class BidirectionalIterator
275 :
public ConstBidirectionalIterator<Container, DataType, Position, Traits>
367 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
368 BidirectionalIterator<Container, DataType, Position, Traits>&
371 Base::operator ++ ();
375 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
376 BidirectionalIterator<Container, DataType, Position, Traits>
379 BidirectionalIterator iterator(*
this);
380 this->operator ++ ();
384 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
385 BidirectionalIterator<Container, DataType, Position, Traits>&
388 Base::operator -- ();
392 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
393 BidirectionalIterator<Container, DataType, Position, Traits>
396 BidirectionalIterator iterator(*
this);
397 this->operator -- ();
401 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
402 BidirectionalIterator<Container, DataType, Position, Traits>
405 BidirectionalIterator iterator(container);
410 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
411 BidirectionalIterator<Container, DataType, Position, Traits>
414 BidirectionalIterator iterator(container);
419 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
420 BidirectionalIterator<Container, DataType, Position, Traits>
423 BidirectionalIterator iterator(container);
428 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
429 BidirectionalIterator<Container, DataType, Position, Traits>
432 BidirectionalIterator iterator(container);
437 template <
typename Container,
typename DataType,
typename Position,
typename Traits>
439 : ConstBidirectionalIterator<Container, DataType,
Position, Traits>(container)
446 #endif // BALL_KERNEL_BIDIRECTIONALITERATOR_H