4#ifndef CTB_DLISTITERATOR_H
5#define CTB_DLISTITERATOR_H
ctb_DListIterator_t * ctb_DListIterator_resetToLast(ctb_DListIterator_t *const self)
Resets the iterator to the last node.
Definition ctb_DListIterator.c:21
bool ctb_DListIterator_hasNext(ctb_DListIterator_t *const self)
Checks if there is a node after the current node.
Definition ctb_DListIterator.c:29
void ctb_DListIterator_forEach(ctb_DListIterator_t *const self, ctb_DListIterator_ForEachOperation_t const operation)
Applies an operation to each node in the doubly linked list.
Definition ctb_DListIterator.c:61
void(* ctb_DListIterator_ForEachOperation_t)(ctb_DNode_t *const node)
Typedef for operation function to be applied to each node in the doubly linked list.
Definition ctb_DListIterator.h:28
ctb_DListIterator_t * ctb_DListIterator_resetToFirst(ctb_DListIterator_t *const self)
Resets the iterator to the first node.
Definition ctb_DListIterator.c:13
ctb_DNode_t * ctb_DListIterator_find(ctb_DListIterator_t *const self, ctb_DListIterator_FindPredicate_t const predicate)
Finds a node in the doubly linked list that satisfies a predicate.
Definition ctb_DListIterator.c:72
ctb_DNode_t * ctb_DListIterator_previous(ctb_DListIterator_t *const self)
Returns the previous node.
Definition ctb_DListIterator.c:51
bool(* ctb_DListIterator_FindPredicate_t)(ctb_DNode_t *const node)
Typedef for predicate function used to find a node in the doubly linked list.
Definition ctb_DListIterator.h:21
ctb_DNode_t * ctb_DListIterator_next(ctb_DListIterator_t *const self)
Returns the next node.
Definition ctb_DListIterator.c:41
bool ctb_DListIterator_hasPrevious(ctb_DListIterator_t *const self)
Checks if there is a node before the current node.
Definition ctb_DListIterator.c:35
ctb_DListIterator_t * ctb_DListIterator_init(ctb_DListIterator_t *const self, ctb_DList_t *const list)
Initializes a doubly linked list iterator.
Definition ctb_DListIterator.c:4
Doubly linked list iterator data structure.
Definition ctb_DListIterator.h:35
ctb_DList_t * list
Definition ctb_DListIterator.h:36
ctb_DNode_t * current
Definition ctb_DListIterator.h:37
Doubly linked list data structure.
Definition ctb_DList.h:20
Doubly linked node data structure.
Definition ctb_DNode.h:15