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

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

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

## Public Types

Typedefs
typedef DataType & | reference
typedef DataType * | pointer
typedef ConstRandomAccessIterator< Container, DataType, Position, Traits > | Base
Public Types inherited from BALL::ConstRandomAccessIterator< Container, DataType, Position, Traits >
typedef std::random_access_iterator_tag | iterator_category
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 Destructors
BALL_INLINE | RandomAccessIterator ()
BALL_INLINE | RandomAccessIterator (const RandomAccessIterator &iterator)
BALL_INLINE | ~RandomAccessIterator ()
Dereferenciation
BALL_INLINE reference | operator[] (Index index) const
BALL_INLINE reference | operator* () const
BALL_INLINE pointer | operator-> () const
Public Member Functions inherited from BALL::ConstRandomAccessIterator< Container, DataType, Position, Traits >
BALL_INLINE | ConstRandomAccessIterator ()
BALL_INLINE | ConstRandomAccessIterator (const ConstRandomAccessIterator &iterator)
BALL_INLINE | ~ConstRandomAccessIterator ()
BALL_INLINE bool | operator+ () const
BALL_INLINE bool | operator- () const
bool | operator< (const ConstRandomAccessIterator &iterator) const
bool | operator<= (const ConstRandomAccessIterator &iterator) const
bool | operator>= (const ConstRandomAccessIterator &iterator) const
bool | operator> (const ConstRandomAccessIterator &iterator) const
ConstRandomAccessIterator & | operator+= (Distance distance)
ConstRandomAccessIterator & | operator-= (Distance distance)
ConstRandomAccessIterator | operator+ (Distance distance) const
ConstRandomAccessIterator | operator- (Distance distance) const
Distance | operator- (const ConstRandomAccessIterator &iterator) const
const DataType & | operator[] (Index index) const
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.

## Assignment

static RandomAccessIterator | begin (const Container &container)
static RandomAccessIterator | end (const Container &container)
static RandomAccessIterator | rbegin (const Container &container)
static RandomAccessIterator | rend (const Container &container)
BALL_INLINE | RandomAccessIterator (const Container &container)

## Additional Inherited Members

static ConstRandomAccessIterator | begin (const Container &container)
static ConstRandomAccessIterator | end (const Container &container)
static ConstRandomAccessIterator | rbegin (const Container &container)
static ConstRandomAccessIterator | rend (const Container &container)
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)
| ConstRandomAccessIterator (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::RandomAccessIterator< Container, DataType, Position, Traits >

Random Access Iterator Class

Definition at line 413 of file randomAccessIterator.h.

## Member Typedef Documentation

## Base

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

typedef ConstRandomAccessIterator<Container, DataType, Position, Traits> BALL::RandomAccessIterator< Container, DataType, Position, Traits >::Base

Definition at line 426 of file randomAccessIterator.h.

## pointer

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

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

Definition at line 424 of file randomAccessIterator.h.

## reference

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

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

Definition at line 422 of file randomAccessIterator.h.

## Constructor & Destructor Documentation

## RandomAccessIterator() [1/3]

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

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

inline

Definition at line 434 of file randomAccessIterator.h.

## RandomAccessIterator() [2/3]

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

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

inline

Definition at line 437 of file randomAccessIterator.h.

## ~RandomAccessIterator()

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

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

inline

Definition at line 443 of file randomAccessIterator.h.

## RandomAccessIterator() [3/3]

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

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

inline protected

Definition at line 489 of file randomAccessIterator.h.

## Member Function Documentation

## begin()

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

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

static

Return a RandomAccessIterator for a given container. It points at the first element.

Exceptions

  Exception::InvalidIterator |

Definition at line 499 of file randomAccessIterator.h.

## end()

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

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

static

Return a RandomAccessIterator for a given container. It points behind the last element of the container.

Exceptions

  Exception::InvalidIterator |

Definition at line 508 of file randomAccessIterator.h.

## operator*()

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

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

inline

Definition at line 454 of file randomAccessIterator.h.

## operator->()

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

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

inline

Definition at line 456 of file randomAccessIterator.h.

## operator[]()

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

BALL_INLINE reference BALL::RandomAccessIterator< Container, DataType, Position, Traits >::operator[] | ( | Index | index | ) | const

inline

Exceptions

  Exception::InvalidIterator |

Definition at line 452 of file randomAccessIterator.h.

## rbegin()

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

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

static

Return a RandomAccessIterator for a given container. It points at the last element of the container.

Exceptions

  Exception::InvalidIterator |

Definition at line 517 of file randomAccessIterator.h.

## rend()

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

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

static

Return a RandomAccessIterator for a given container. It points before the first element.

Exceptions

  Exception::InvalidIterator |

Definition at line 526 of file randomAccessIterator.h.