LibRCG  3.1.1
iterator.h
Go to the documentation of this file.
1 
11 #ifndef _ITERATOR_H_
12 #define _ITERATOR_H_
13 
17 typedef struct sIterator
18 {
20  int capacity;
22  int size;
24  int pos;
26  void** values;
27 }SIterator;
28 
33 
34 //==============================================================================
35 
45 Iterator newIt(int size);
46 
52 void itDelete(Iterator it);
53 
65 int itAdd(Iterator it,void* val);
66 
77 int itNext(Iterator it,void** val);
78 
88 int itHasNext(Iterator it);
89 
100 int itPrev(Iterator it,void** val);
101 
111 int itHasPrev(Iterator it);
112 
126 int itAt(Iterator it,int index,void** elem);
127 
140 int itSetPos(Iterator it,int n);
141 
150 int itGetPos(Iterator it);
151 
152 #endif
int itPrev(Iterator it, void **val)
Provides the previous element of an iterator.
Definition: iterator.c:84
int itHasNext(Iterator it)
Checks if there is "next".
Definition: iterator.c:76
int itGetPos(Iterator it)
Provides the current position of an iterator.
Definition: iterator.c:137
int itNext(Iterator it, void **val)
Provides the next element of an iterator.
Definition: iterator.c:58
void ** values
Elements of this iterator.
Definition: iterator.h:26
int itHasPrev(Iterator it)
Checks if there is "previous".
Definition: iterator.c:102
SIterator * Iterator
Iterator definition.
Definition: iterator.h:32
int size
Number of elements of this iterator.
Definition: iterator.h:22
Iterator structure.
Definition: iterator.h:17
void itDelete(Iterator it)
Deletes an iterator.
Definition: iterator.c:36
int itAdd(Iterator it, void *val)
Adds an element to an iterator.
Definition: iterator.c:44
int capacity
Capacity of this iterator..
Definition: iterator.h:20
int itSetPos(Iterator it, int n)
Sets the current position of an iterator.
Definition: iterator.c:124
int itAt(Iterator it, int index, void **elem)
Provides the element at the specified position of an iterator.
Definition: iterator.c:110
Iterator newIt(int size)
Creates an iterator.
Definition: iterator.c:12
int pos
Current position of this iterator.
Definition: iterator.h:24

LibRCG © 2004-2015   Rui Carlos Gonçalves