atobase 3.2.0
ATOMAS atobase
Iterator

Use iterators returned by various SDK APIs. More...

Typedefs

typedef struct _ato_Iterator ato_Iterator
 The iteration object. More...
 

Functions

ATO_EXPORT void ato_iter_free (ato_Iterator *iter)
 Free an iterator. More...
 
ATO_EXPORT void * ato_iter_firstv (ato_Iterator *iter)
 Get the first value in the collection. More...
 
ATO_EXPORT void * ato_iter_nextv (ato_Iterator *iter)
 Get the next value in the collection - see also ato_iter_firstv(). More...
 

Detailed Description

Use iterators returned by various SDK APIs.

Typedef Documentation

◆ ato_Iterator

typedef struct _ato_Iterator ato_Iterator

The iteration object.

Note that the underlying container is implementation dependent, private, and therefore not exposed. The iterator methods simply return the underlying values which must be cast to the correct type. Warning: this is not type safe, so be sure to use the correct iterator for the type.

Preferably, where an object implements a collection (or multiple), it should provide type-safe wrappers for these methods for the given collection.

Function Documentation

◆ ato_iter_free()

ATO_EXPORT void ato_iter_free ( ato_Iterator iter)

Free an iterator.

Parameters
iterthe iterator.

◆ ato_iter_firstv()

ATO_EXPORT void * ato_iter_firstv ( ato_Iterator iter)

Get the first value in the collection.

This also primes or resets the iterator to the start for use by ato_iter_nextv().

Parameters
iterthe iterator.
Returns
a new iterator.

◆ ato_iter_nextv()

ATO_EXPORT void * ato_iter_nextv ( ato_Iterator iter)

Get the next value in the collection - see also ato_iter_firstv().

Parameters
iterthe iterator.
Returns
a new iterator.