LibRCG
3.1.1
|
Implementation of an iterator. More...
Go to the source code of this file.
Data Structures | |
struct | SIterator |
Iterator structure. More... | |
Typedefs | |
typedef SIterator * | Iterator |
Iterator definition. More... | |
Functions | |
Iterator | newIt (int size) |
Creates an iterator. More... | |
void | itDelete (Iterator it) |
Deletes an iterator. More... | |
int | itAdd (Iterator it, void *val) |
Adds an element to an iterator. More... | |
int | itNext (Iterator it, void **val) |
Provides the next element of an iterator. More... | |
int | itHasNext (Iterator it) |
Checks if there is "next". More... | |
int | itPrev (Iterator it, void **val) |
Provides the previous element of an iterator. More... | |
int | itHasPrev (Iterator it) |
Checks if there is "previous". More... | |
int | itAt (Iterator it, int index, void **elem) |
Provides the element at the specified position of an iterator. More... | |
int | itSetPos (Iterator it, int n) |
Sets the current position of an iterator. More... | |
int | itGetPos (Iterator it) |
Provides the current position of an iterator. More... | |
Implementation of an iterator.
Iterators contain a sequence of pointers to the elements to be iterated.
Definition in file iterator.h.
Iterator definition.
Definition at line 32 of file iterator.h.
int itAdd | ( | Iterator | it, |
void * | val | ||
) |
Adds an element to an iterator.
In case the iterator is full, the element is not added.
it | the iterator |
val | the value to be added |
Definition at line 44 of file iterator.c.
int itAt | ( | Iterator | it, |
int | index, | ||
void ** | elem | ||
) |
Provides the element at the specified position of an iterator.
Verifica qual o elemento numa determinada posição do array de valores de um iterador.
it | the iterator |
index | the position |
elem | pointer were the element at the specified position will be put |
Definition at line 110 of file iterator.c.
void itDelete | ( | Iterator | it | ) |
Deletes an iterator.
it | the iterator to be deleted |
Definition at line 36 of file iterator.c.
int itGetPos | ( | Iterator | it | ) |
Provides the current position of an iterator.
it | the iterator |
Definition at line 137 of file iterator.c.
int itHasNext | ( | Iterator | it | ) |
Checks if there is "next".
it | the iterator. |
Definition at line 76 of file iterator.c.
int itHasPrev | ( | Iterator | it | ) |
Checks if there is "previous".
it | the iterator. |
Definition at line 102 of file iterator.c.
int itNext | ( | Iterator | it, |
void ** | val | ||
) |
Provides the next element of an iterator.
it | the iterator |
val | pointer were the next element should be put |
Definition at line 58 of file iterator.c.
int itPrev | ( | Iterator | it, |
void ** | val | ||
) |
Provides the previous element of an iterator.
it | the iterator |
val | pointer were the previous element should be put |
Definition at line 84 of file iterator.c.
int itSetPos | ( | Iterator | it, |
int | n | ||
) |
Sets the current position of an iterator.
It changes the value of field pos
of an iterator (if the value og n
is valid).
it | the iterator |
n | the new position |
Definition at line 124 of file iterator.c.
Iterator newIt | ( | int | size | ) |
Creates an iterator.
size | the capacity |
NULL
if an error occurredDefinition at line 12 of file iterator.c.
LibRCG © 2004-2015 Rui Carlos Gonçalves