Tinyhash
This is a library containing multiple C implementations of hashmap.
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
iterator.h File Reference
#include "key.h"
#include "types.h"
Include dependency graph for iterator.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  th_iterator_s
 Represents an iterator that allow to iterate over a generic table. More...
 

Typedefs

typedef struct th_iterator_s th_iterator_t
 Represents an iterator that allow to iterate over a generic table.
 
typedef bool(* th_iterator_next_func_t) (th_iterator_t **)
 Pointer on function that get the next element.
 

Functions

th_iterator_tth_iterator_create (th_generic_table_t generic_table, th_iterator_next_func_t next)
 Allocate then init a new iterator.
 
void th_iterator_free (th_iterator_t *it)
 Free an iterator.
 
bool th_iterator_next (th_iterator_t **ptr)
 Try to get the next element. Free the iterator if it reachs the end.
 

Typedef Documentation

◆ th_iterator_next_func_t

typedef bool(* th_iterator_next_func_t) (th_iterator_t **)

Pointer on function that get the next element.

Definition at line 24 of file iterator.h.

◆ th_iterator_t

typedef struct th_iterator_s th_iterator_t

Represents an iterator that allow to iterate over a generic table.

Function Documentation

◆ th_iterator_create()

th_iterator_t * th_iterator_create ( th_generic_table_t generic_table,
th_iterator_next_func_t next )

Allocate then init a new iterator.

Parameters
generic_table
next
Returns
th_iterator_t*

Definition at line 16 of file iterator.c.

References th_iterator_init().

Referenced by th_oa_iterator_begin(), and th_sc_iterator_begin().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ th_iterator_free()

void th_iterator_free ( th_iterator_t * it)

Free an iterator.

Parameters
it

Definition at line 29 of file iterator.c.

References th_iterator_init().

Referenced by th_iterator_next().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ th_iterator_next()

bool th_iterator_next ( th_iterator_t ** ptr)

Try to get the next element. Free the iterator if it reachs the end.

Parameters
ptr
Returns
true
false

Definition at line 35 of file iterator.c.

References th_iterator_s::next, and th_iterator_free().

Here is the call graph for this function: