5 #ifndef BALL_KERNEL_ITERATOR_H
6 #define BALL_KERNEL_ITERATOR_H
8 #ifndef BALL_CONCEPT_BIDIRECTIONALITERATOR_H
12 #ifndef BALL_CONCEPT_COMPOSITE_H
25 #define BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Type) \
29 return Type##Iterator::begin(*this); \
35 return Type##Iterator::end(*this); \
38 Type##ReverseIterator \
41 return Type##ReverseIterator(end##Type ()); \
44 Type##ReverseIterator \
47 return Type##ReverseIterator(begin##Type ()); \
51 begin##Type () const \
53 return Type##ConstIterator::begin(*this); \
59 return Type##ConstIterator::end(*this); \
62 Type##ConstReverseIterator \
63 rbegin##Type () const \
65 return Type##ConstReverseIterator(end##Type ()); \
68 Type##ConstReverseIterator \
71 return Type##ConstReverseIterator(begin##Type ()); \
141 inline bool isValid()
const {
return ((bound_ != 0) && composite_iterator_.isValid()); }
149 inline bool isBegin()
const;
155 inline bool isEnd()
const
157 return composite_iterator_.isEnd();
164 inline bool isRBegin()
const;
170 inline bool isREnd()
const;
183 inline void invalidate();
189 inline void toBegin();
204 inline void forward();
207 inline void backward();
212 inline void toRBegin();
217 inline void toREnd();
240 composite_iterator_(),
246 : bound_(const_cast<
Composite*>(&composite)),
247 composite_iterator_(const_cast<
Composite&>(composite).beginComposite()),
253 : bound_(traits.bound_),
254 composite_iterator_(traits.composite_iterator_),
255 predicate_(traits.predicate_)
303 while (+sub_iterator && (
predicate_->operator () (*sub_iterator) ==
false))
323 return const_cast<Composite&
>(*composite_iterator_);
358 while (+sub_iterator && (
predicate_->operator () (*sub_iterator) ==
false))
389 #endif // BALL_KERNEL_ITERATOR_H