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.
Iterator Struct Reference

A datatype for abstracting out the method of moving from one entry in a LinkedList to the next. More...

#include <linked_list_iterator.h>

Public Member Functions

IteratorGetLinkedListIterator (LinkedList *list_p)
 Get an Iterator for a LinkedList. More...
 
void * GetNextItemFromIterator (Iterator *iterator_p)
 Get the next entry in the LinkedList associated with an Iterator. More...
 
void FreeIterator (Iterator *iterator_p)
 Free the Iterator. More...
 

Data Fields

void *(* it_get_next_item_fn )(struct Iterator *iterator_p)
 The callback function to move from one entry in a LinkedList to the next. More...
 

Detailed Description

A datatype for abstracting out the method of moving from one entry in a LinkedList to the next.

This moves from one ListItem to the next and returns the data starting directly after the base ListItem, not the ListItem itself.

See also
LinkedList

Member Function Documentation

◆ GetLinkedListIterator()

Iterator * GetLinkedListIterator ( LinkedList list_p)

Get an Iterator for a LinkedList.

Parameters
list_pThe LinkedList to get the Iterator for.
Returns
The new Iterator which will be positioned at the beginning of the LinkedList or NULL upon error.

◆ GetNextItemFromIterator()

void * GetNextItemFromIterator ( Iterator iterator_p)

Get the next entry in the LinkedList associated with an Iterator.

Parameters
iterator_pThe Iterator to get the next entry from.
Returns
The next entry in the underlying LinkedList or NULL if the end of the LinkedList has been reached. Note that the data returned is that starting directly after the base ListItem, not the ListItem itself.

◆ FreeIterator()

void FreeIterator ( Iterator iterator_p)

Free the Iterator.

Parameters
iterator_pThe Iterator to free.

Field Documentation

◆ it_get_next_item_fn

void*(* it_get_next_item_fn) (struct Iterator *iterator_p)

The callback function to move from one entry in a LinkedList to the next.

Parameters
iterator_pThis iterator.

The documentation for this struct was generated from the following file: