libdacav 0.9.0
/home/dacav/Projects/libdacav/libdacav/dacav/dacaviter.h File Reference

Iterator implementation. More...

#include <dacav/dacav.h>

Go to the source code of this file.

Typedefs

typedef struct diter diter_t
 Opaque type for iterators.
typedef int(* dhasnext_t )(void *iterable)
 Type defining the Has-Next function for iterators.
typedef void *(* dnext_t )(void *iterable)
 Type defining the Next function for iterators.
typedef void(* dremove_t )(void *iterable)
 Type defining the Remove function for iterators.
typedef void(* dreplace_t )(void *iterable, void *new_val)
 Type defining the Replace function for iterators.

Functions

int diter_hasnext (diter_t *i)
 Has-Next predicate, checks if the iterator has at least another element.
void * diter_next (diter_t *i)
 Get-Next function, extracts the next element of the iteration.
void diter_remove (diter_t *i)
 Remove function, removes from the structure the current element.
void diter_replace (diter_t *i, void *n)
 Replace function, replaces the current element of the structure.
diter_tditer_new (dnext_t nx, dhasnext_t hnx, dremove_t rm, dreplace_t rep, unsigned iterable_size)
 Raw constructor for iterator.
void * diter_get_iterable (diter_t *i)
 Getter for the iterable structure.
void diter_free (diter_t *it)
 Destructor for the raw iterator.

Detailed Description

Iterator implementation.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator