Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
linked_list_iterator.h
Go to the documentation of this file.
1 /*
2 ** Copyright 2014-2016 The Earlham Institute
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 
21 #ifndef LINKED_LIST_ITERATOR_H
22 #define LINKED_LIST_ITERATOR_H
23 
25 #include "linked_list.h"
26 
27 struct Iterator;
28 
40 typedef struct Iterator
41 {
47  void *(*it_get_next_item_fn) (struct Iterator *iterator_p);
48 
49 } Iterator;
50 
51 #ifdef __cplusplus
52  extern "C" {
53 #endif
54 
65 
66 
78 
79 
86 GRASSROOTS_UTIL_API void FreeIterator (Iterator *iterator_p);
87 
88 
89 #ifdef __cplusplus
90 }
91 #endif
92 
93 
94 #endif /* #ifndef LINKED_LIST_ITERATOR_H */
Iterator::FreeIterator
void FreeIterator(Iterator *iterator_p)
Free the Iterator.
grassroots_util_library.h
Iterator::GetLinkedListIterator
Iterator * GetLinkedListIterator(LinkedList *list_p)
Get an Iterator for a LinkedList.
Iterator::GetNextItemFromIterator
void * GetNextItemFromIterator(Iterator *iterator_p)
Get the next entry in the LinkedList associated with an Iterator.
LinkedList
A doubly-linked list that can be traversed in either direction.
Definition: linked_list.h:56
Iterator
A datatype for abstracting out the method of moving from one entry in a LinkedList to the next.
Definition: linked_list_iterator.h:40
linked_list.h
A doubly-linked list.
GRASSROOTS_UTIL_API
#define GRASSROOTS_UTIL_API
Definition: grassroots_util_library.h:47