---
name: "ACE_Stream_Iterator"
section: "3"
platform: "linux"
package: "libace-doc"
version: "5.0.7-4"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/ACE_Stream_Iterator"
---

# ACE\_Stream\_Iterator(3)

Iterate through an ACE\_Stream.

## NAME

ACE\_Stream\_Iterator -  Iterate through an ACE\_Stream.

## SYNOPSIS

```
#include <ace/Stream.h>
template<ACE_SYNCH_DECL>
class ACE_Stream_Iterator
{
  public:
    ACE_Stream_Iterator (const ACE_Stream<ACE_SYNCH_USE> &sr);
    int next (const ACE_Module<ACE_SYNCH_USE> *&next_item);
    int done (void) const;
    int advance (void);
  private:
    ACE_Module<ACE_SYNCH_USE> *next_;
};
```

## Initialization method.

```
ACE_Stream_Iterator (const ACE_Stream<ACE_SYNCH_USE> &sr);
```

## Iteration methods.

```
int next (const ACE_Module<ACE_SYNCH_USE> *&next_item);
```

Pass back the next\_item that hasn't been seen in the set. Returns 0 when all items have been seen, else 1.

```
int done (void) const;
```

Returns 1 when all items have been seen, else 0.

```
int advance (void);
```

Move forward by one element in the set.  Returns 0 when all the items in the set have been seen, else 1.

## AUTHOR

Doug Schmidt

## LIBRARY

ace
