Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix dependency issue to prevent problems with make -jx
[simgrid.git] / teshsuite / msg / app-chainsend / iterator.h
1 /* Copyright (c) 2012-2018. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef ITERATOR_H
8 #define ITERATOR_H
9
10 #include "xbt/dynar.h"
11 #include "xbt/sysdep.h"
12
13 /* Random iterator for xbt_dynar */
14 typedef struct xbt_dynar_iterator_struct {
15   xbt_dynar_t list;
16   xbt_dynar_t indices_list;
17   int current;
18   unsigned long length;
19   xbt_dynar_t (*criteria_fn)(int size);
20 } * xbt_dynar_iterator_t;
21 typedef struct xbt_dynar_iterator_struct xbt_dynar_iterator_s;
22
23 /* Iterator methods */
24 xbt_dynar_iterator_t xbt_dynar_iterator_new(xbt_dynar_t list, xbt_dynar_t (*criteria_fn)(int));
25 void* xbt_dynar_iterator_next(xbt_dynar_iterator_t it);
26 void xbt_dynar_iterator_delete(xbt_dynar_iterator_t it);
27
28 /* Iterator generators */
29 xbt_dynar_t forward_indices_list(int size);
30
31 #endif /* ITERATOR_H */