TaPAS
0.2
|
A generic iterator interface. More...
Go to the source code of this file.
Macros | |
#define | CCL_ITERATOR_TYPEDEF(_typename_, _eltype_) |
Macro-function used to define and declare a new iterator type. More... | |
#define | ccl_iterator_has_more_elements(i) ((i)->has_more_elements (i)) |
Checks if it remains elements to visit. More... | |
#define | ccl_iterator_next_element(i) ((i)->next_element (i)) |
Returns the next element. More... | |
#define | ccl_iterator_delete(i) ((i)->delete_iterator (i)) |
Releases the resources allocated to i. More... | |
Functions | |
CCL_ITERATOR_TYPEDEF (ccl_pointer_iterator, void *) | |
The type of iterators returning a void pointer. | |
CCL_ITERATOR_TYPEDEF (ccl_int_iterator, int) | |
The type of iterators returning an integer. | |
A generic iterator interface.
Definition in file ccl-iterator.h.
#define ccl_iterator_delete | ( | i | ) | ((i)->delete_iterator (i)) |
Releases the resources allocated to i.
i | the iterator |
Definition at line 81 of file ccl-iterator.h.
#define ccl_iterator_has_more_elements | ( | i | ) | ((i)->has_more_elements (i)) |
Checks if it remains elements to visit.
i | the iterator |
Definition at line 67 of file ccl-iterator.h.
#define ccl_iterator_next_element | ( | i | ) | ((i)->next_element (i)) |
Returns the next element.
i | the iterator |
Definition at line 75 of file ccl-iterator.h.
#define CCL_ITERATOR_TYPEDEF | ( | _typename_, | |
_eltype_ | |||
) |
Macro-function used to define and declare a new iterator type.
An iterator is a structure containing 3 pointers of functions:
int (*has_more_elements) (const typename *i)
that has to return a non-null value if there remains elements to visit. _eltype_ (*next_element) (typename *i)
that returns the next element to visite. void (*delete_iterator) (typename *i)
that clean-up the resources allocated to the iterator.The three methods have to be implemented.
<em>typename</em> | the name of the new type. |
<em>eltype</em> | the type of object handled by the iterator. |
Definition at line 43 of file ccl-iterator.h.