- Main Page
- Modules
- Classes
- Files
- Directories
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# cArray::Iterator Class Reference

`#include <carray.h>`

List of all members.

## Detailed Description

Walks along a cArray.

## Public Member Functions
| Iterator (const cArray &a, bool athead=true)
void | init (const cArray &a, bool athead=true)
cObject * | operator() ()
bool | end () const
cObject * | operator++ (int)
cObject * | operator-- (int)

## Constructor & Destructor Documentation

cArray::Iterator::Iterator | ( | const cArray & | a,
|  | bool | athead = `true`
| ) | `[inline]`

| Constructor. Iterator will walk on the array passed as argument. The starting object will be the first (if athead==true) or the last (athead==false) object in the array, not counting empty slots.

## Member Function Documentation

bool cArray::Iterator::end | ( |  | ) | const`[inline]`

| Returns true if the iterator has reached either end of the array.

void cArray::Iterator::init | ( | const cArray & | a,
|  | bool | athead = `true`
| ) |

| Reinitializes the iterator object.

cObject* cArray::Iterator::operator() | ( |  | ) | `[inline]`

| Returns the current object, or NULL if the iterator is not at a valid position.

cObject* cArray::Iterator::operator++ | ( | int |  | ) |

| Returns the current object, then moves the iterator to the next item. Empty slots in the array are skipped. If the iterator has reached either end of the array, nothing happens; you have to call init() again to restart iterating. If elements are added or removed during interation, the behaviour is undefined.

cObject* cArray::Iterator::operator-- | ( | int |  | ) |

| Returns the current object, then moves the iterator to the previous item. Empty slots in the array are skipped. If the iterator has reached either end of the array, nothing happens; you have to call init() again to restart iterating. If elements are added or removed during interation, the behaviour is undefined.

The documentation for this class was generated from the following file:

- carray.h