Loading...
Searching...
No Matches
BALL::BidirectionalIterator< Container, DataType, Position, Traits > Class Template Reference

Mutable bidirectional iterator. More...

`#include <BALL/CONCEPT/bidirectionalIterator.h>`

Inheritance diagram for BALL::BidirectionalIterator< Container, DataType, Position, Traits >:

## Public Types

Typedefs
typedef DataType & | reference
typedef DataType * | pointer
typedef ConstBidirectionalIterator< Container, DataType, Position, Traits > | Base
Public Types inherited from BALL::ConstBidirectionalIterator< Container, DataType, Position, Traits >
typedef std::bidirectional_iterator_tag | iterator_category
typedef ConstForwardIterator< Container, DataType, Position, Traits > | Base
Public Types inherited from BALL::ConstForwardIterator< Container, DataType, Position, Traits >
typedef std::forward_iterator_tag | iterator_category
typedef BaseIterator< Container, DataType, Position, Traits > | Base
Public Types inherited from BALL::BaseIterator< Container, DataType, Position, Traits >
typedef DataType | value_type
typedef Position | difference_type
typedef const DataType * | pointer
typedef const DataType & | reference
typedef std::input_iterator_tag | iterator_category

## Public Member Functions

Constructors and Destructor
BALL_INLINE | BidirectionalIterator ()
| Default constructor.
BALL_INLINE | BidirectionalIterator (const BidirectionalIterator &iterator)
| Copy constructor.
BALL_INLINE | ~BidirectionalIterator ()
| Destructor.
Public Member Functions inherited from BALL::ConstBidirectionalIterator< Container, DataType, Position, Traits >
BALL_INLINE | ConstBidirectionalIterator ()
BALL_INLINE | ConstBidirectionalIterator (const ConstBidirectionalIterator &iterator)
BALL_INLINE | ~ConstBidirectionalIterator ()
BALL_INLINE void | toBegin ()
BALL_INLINE bool | isBegin () const
| Check whether the iterator points to the item at the beginning of the container.
void | toEnd ()
BALL_INLINE bool | isEnd () const
| Check whether the iterator points to the position after the last item of the container.
void | toRBegin ()
BALL_INLINE bool | isRBegin () const
| Test whether the iterator points to the "reverse" first element of the container.
void | toREnd ()
BALL_INLINE bool | isREnd () const
| Test wheter the iterator points to the position before the first element.
BALL_INLINE ConstBidirectionalIterator & | operator++ ()
BALL_INLINE ConstBidirectionalIterator | operator++ (int)
BALL_INLINE ConstBidirectionalIterator & | operator-- ()
BALL_INLINE ConstBidirectionalIterator | operator-- (int)
Public Member Functions inherited from BALL::ConstForwardIterator< Container, DataType, Position, Traits >
BALL_INLINE | ConstForwardIterator ()
| Default constructor.
BALL_INLINE | ConstForwardIterator (const ConstForwardIterator &iterator)
| Copy constructor.
BALL_INLINE | ~ConstForwardIterator ()
BALL_INLINE ConstForwardIterator & | operator= (const ConstForwardIterator &iterator)
BALL_INLINE void | swap (ConstForwardIterator &iterator)
BALL_INLINE void | toBegin ()
BALL_INLINE bool | isBegin () const
| Check whether the iterator points to the first item of the container.
BALL_INLINE void | toEnd ()
BALL_INLINE bool | isEnd () const
| Check whether the iterator points behind the last item of the container.
BALL_INLINE ConstForwardIterator & | operator++ ()
BALL_INLINE ConstForwardIterator | operator++ (int)
Public Member Functions inherited from BALL::BaseIterator< Container, DataType, Position, Traits >
BALL_INLINE | BaseIterator ()
| Default constructor.
BALL_INLINE | BaseIterator (const BaseIterator &iterator)
| Copy constructor.
BALL_INLINE | ~BaseIterator ()
| Destructor.
BALL_INLINE BaseIterator & | operator= (const BaseIterator &iterator)
BALL_INLINE void | swap (BaseIterator &iterator)
| Swap two iterators.
BALL_INLINE void | invalidate ()
| Invalidate the iterator.
BALL_INLINE void | setTraits (const Traits &traits)
| Set the traits.
BALL_INLINE const Traits & | getTraits () const
| Get a constant reference to the traits of this iterator.
BALL_INLINE Traits & | getTraits ()
| Get a constant reference to the traits of this iterator.
BALL_INLINE const Container * | getContainer () const
| Get a constant pointer to the container of this iterator.
BALL_INLINE | operator const Position & () const
BALL_INLINE reference | operator* () const
| Convert an iterator to its Datatype by returning a reference to the current data.
BALL_INLINE pointer | operator-> () const
| Return a pointer to the current data.
BALL_INLINE bool | operator== (const BaseIterator &iterator) const
| Equality operator.
BALL_INLINE bool | operator!= (const BaseIterator &iterator) const
| Inequality operator.
BALL_INLINE bool | isSingular () const
BALL_INLINE bool | isValid () const
BALL_INLINE bool | operator+ () const
| Validity predicate.
BALL_INLINE bool | operator- () const
| Invalidity perdicate.

## Iterator methods

BALL_INLINE reference | operator* () const
| Dereferentiation.
BALL_INLINE pointer | operator-> () const
| Pointer dereferentiation.
BALL_INLINE BidirectionalIterator & | operator++ ()
BALL_INLINE BidirectionalIterator | operator++ (int)
BALL_INLINE BidirectionalIterator & | operator-- ()
BALL_INLINE BidirectionalIterator | operator-- (int)
static BidirectionalIterator | begin (const Container &container)
static BidirectionalIterator | end (const Container &container)
static BidirectionalIterator | rbegin (const Container &container)
static BidirectionalIterator | rend (const Container &container)
BALL_INLINE | BidirectionalIterator (const Container &container)
| Construct an iterator bound to a specific container.

## Additional Inherited Members

static ConstBidirectionalIterator | begin (const Container &container)
static ConstBidirectionalIterator | end (const Container &container)
static ConstBidirectionalIterator | rbegin (const Container &container)
static ConstBidirectionalIterator | rend (const Container &container)
static ConstForwardIterator | begin (const Container &container)
static ConstForwardIterator | end (const Container &container)
BALL_INLINE | ConstBidirectionalIterator (const Container &container)
| Construct an iterator bound to a specific container.
BALL_INLINE | ConstForwardIterator (const Container &container)
BALL_INLINE | BaseIterator (const Container &container)

## Detailed Description

template<typename Container, typename DataType, typename Position, typename Traits>
class BALL::BidirectionalIterator< Container, DataType, Position, Traits >

Mutable bidirectional iterator.

Definition at line 258 of file bidirectionalIterator.h.

## Member Typedef Documentation

## Base

template<typename Container, typename DataType, typename Position, typename Traits>

typedef ConstBidirectionalIterator<Container, DataType, Position, Traits> BALL::BidirectionalIterator< Container, DataType, Position, Traits >::Base

Definition at line 272 of file bidirectionalIterator.h.

## pointer

template<typename Container, typename DataType, typename Position, typename Traits>

typedef DataType* BALL::BidirectionalIterator< Container, DataType, Position, Traits >::pointer

Definition at line 270 of file bidirectionalIterator.h.

## reference

template<typename Container, typename DataType, typename Position, typename Traits>

typedef DataType& BALL::BidirectionalIterator< Container, DataType, Position, Traits >::reference

Definition at line 268 of file bidirectionalIterator.h.

## Constructor & Destructor Documentation

## BidirectionalIterator() [1/3]

template<typename Container, typename DataType, typename Position, typename Traits>

BALL_INLINE BALL::BidirectionalIterator< Container, DataType, Position, Traits >::BidirectionalIterator | ( |  | ) |

inline

Default constructor.

Definition at line 280 of file bidirectionalIterator.h.

## BidirectionalIterator() [2/3]

template<typename Container, typename DataType, typename Position, typename Traits>

BALL_INLINE BALL::BidirectionalIterator< Container, DataType, Position, Traits >::BidirectionalIterator | ( | const BidirectionalIterator< Container, DataType, Position, Traits > & | iterator | ) |

inline

Copy constructor.

Definition at line 283 of file bidirectionalIterator.h.

## ~BidirectionalIterator()

template<typename Container, typename DataType, typename Position, typename Traits>

BALL_INLINE BALL::BidirectionalIterator< Container, DataType, Position, Traits >::~BidirectionalIterator | ( |  | ) |

inline

Destructor.

Definition at line 290 of file bidirectionalIterator.h.

## BidirectionalIterator() [3/3]

template<typename Container, typename DataType, typename Position, typename Traits>

BALL_INLINE BALL::BidirectionalIterator< Container, DataType, Position, Traits >::BidirectionalIterator | ( | const Container & | container | ) |

protected

Construct an iterator bound to a specific container.

Definition at line 432 of file bidirectionalIterator.h.

## Member Function Documentation

## begin()

template<typename Container, typename DataType, typename Position, typename Traits>

BALL_INLINE BidirectionalIterator< Container, DataType, Position, Traits > BALL::BidirectionalIterator< Container, DataType, Position, Traits >::begin | ( | const Container & | container | ) |

static

Return an iterator pointing to the first item of the container

Exceptions

  Exception::Precondition |

Definition at line 393 of file bidirectionalIterator.h.

## end()

template<typename Container, typename DataType, typename Position, typename Traits>

BALL_INLINE BidirectionalIterator< Container, DataType, Position, Traits > BALL::BidirectionalIterator< Container, DataType, Position, Traits >::end | ( | const Container & | container | ) |

static

Return an iterator pointing to the position after the last element

Exceptions

  Exception::Precondition |

Definition at line 403 of file bidirectionalIterator.h.

## operator*()

template<typename Container, typename DataType, typename Position, typename Traits>

BALL_INLINE reference BALL::BidirectionalIterator< Container, DataType, Position, Traits >::operator* | ( |  | ) | const

inline

Dereferentiation.

Definition at line 299 of file bidirectionalIterator.h.

## operator++() [1/2]

template<typename Container, typename DataType, typename Position, typename Traits>

BALL_INLINE BidirectionalIterator< Container, DataType, Position, Traits > & BALL::BidirectionalIterator< Container, DataType, Position, Traits >::operator++ | ( |  | ) |

Increment operator

Exceptions

  Exception::Precondition |

Definition at line 355 of file bidirectionalIterator.h.

## operator++() [2/2]

template<typename Container, typename DataType, typename Position, typename Traits>

BALL_INLINE BidirectionalIterator< Container, DataType, Position, Traits > BALL::BidirectionalIterator< Container, DataType, Position, Traits >::operator++ | ( | int |  | ) |

Postfix increment operator

Exceptions

  Exception::Precondition |

Definition at line 364 of file bidirectionalIterator.h.

## operator--() [1/2]

template<typename Container, typename DataType, typename Position, typename Traits>

BALL_INLINE BidirectionalIterator< Container, DataType, Position, Traits > & BALL::BidirectionalIterator< Container, DataType, Position, Traits >::operator-- | ( |  | ) |

Decrement operator

Exceptions

  Exception::Precondition |

Definition at line 374 of file bidirectionalIterator.h.

## operator--() [2/2]

template<typename Container, typename DataType, typename Position, typename Traits>

BALL_INLINE BidirectionalIterator< Container, DataType, Position, Traits > BALL::BidirectionalIterator< Container, DataType, Position, Traits >::operator-- | ( | int |  | ) |

Postfix decrement operator

Exceptions

  Exception::Precondition |

Definition at line 383 of file bidirectionalIterator.h.

## operator->()

template<typename Container, typename DataType, typename Position, typename Traits>

BALL_INLINE pointer BALL::BidirectionalIterator< Container, DataType, Position, Traits >::operator-> | ( |  | ) | const

inline

Pointer dereferentiation.

Definition at line 302 of file bidirectionalIterator.h.

## rbegin()

template<typename Container, typename DataType, typename Position, typename Traits>

BALL_INLINE BidirectionalIterator< Container, DataType, Position, Traits > BALL::BidirectionalIterator< Container, DataType, Position, Traits >::rbegin | ( | const Container & | container | ) |

static

Return an iterator pointing to the last element.

Exceptions

  Exception::Precondition |

Definition at line 413 of file bidirectionalIterator.h.

## rend()

template<typename Container, typename DataType, typename Position, typename Traits>

BALL_INLINE BidirectionalIterator< Container, DataType, Position, Traits > BALL::BidirectionalIterator< Container, DataType, Position, Traits >::rend | ( | const Container & | container | ) |

static

Return an iterator pointing to the positon before the first element

Exceptions

  Exception::Precondition |

Definition at line 423 of file bidirectionalIterator.h.