-
Notifications
You must be signed in to change notification settings - Fork 0
/
iterator.h
24 lines (17 loc) · 1.08 KB
/
iterator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef ITERATOR_H
#define ITERATOR_H
#include <stdbool.h>
typedef struct Iterator Iterator;
typedef bool IteratorHasNextFunction(int numIteratorFields, void ** iteratorFields);
typedef bool IteratorHasPreviousFunction(int numIteratorFields, void ** iteratorFields);
typedef void* IteratorGetNextFunction(int numIteratorFields, void ** iteratorFields);
typedef void* IteratorGetPreviousFunction(int numIteratorFields, void ** iteratorFields);
typedef void IteratorDestructor(int numIteratorFields, void ** iteratorFields);
Iterator * iteratorInit(IteratorHasNextFunction * iteratorHasNextFunction, IteratorHasPreviousFunction * iteratorHasPreviousFunction, IteratorGetNextFunction * iteratorGetNextFunction,
IteratorGetPreviousFunction * iteratorGetPreviousFunction, IteratorDestructor * iteratorDestructor, int numIteratorFields, ...);
void iteratorDestroy(Iterator * iterator);
bool iteratorHasNext(Iterator * iterator);
bool iteratorHasPrevious(Iterator * iterator);
void * iteratorGetNext(Iterator * iterator);
void * iteratorGetPrevious(Iterator * iterator);
#endif // ITERATOR_H