1 | /* |
2 | Typedefs used by various components |
3 | */ |
4 | |
5 | #ifndef ROARING_TYPES_H |
6 | #define ROARING_TYPES_H |
7 | |
8 | typedef bool (*roaring_iterator)(uint32_t value, void *param); |
9 | typedef bool (*roaring_iterator64)(uint64_t value, void *param); |
10 | |
11 | /** |
12 | * (For advanced users.) |
13 | * The roaring_statistics_t can be used to collect detailed statistics about |
14 | * the composition of a roaring bitmap. |
15 | */ |
16 | typedef struct roaring_statistics_s { |
17 | uint32_t n_containers; /* number of containers */ |
18 | |
19 | uint32_t n_array_containers; /* number of array containers */ |
20 | uint32_t n_run_containers; /* number of run containers */ |
21 | uint32_t n_bitset_containers; /* number of bitmap containers */ |
22 | |
23 | uint32_t |
24 | n_values_array_containers; /* number of values in array containers */ |
25 | uint32_t n_values_run_containers; /* number of values in run containers */ |
26 | uint32_t |
27 | n_values_bitset_containers; /* number of values in bitmap containers */ |
28 | |
29 | uint32_t n_bytes_array_containers; /* number of allocated bytes in array |
30 | containers */ |
31 | uint32_t n_bytes_run_containers; /* number of allocated bytes in run |
32 | containers */ |
33 | uint32_t n_bytes_bitset_containers; /* number of allocated bytes in bitmap |
34 | containers */ |
35 | |
36 | uint32_t |
37 | max_value; /* the maximal value, undefined if cardinality is zero */ |
38 | uint32_t |
39 | min_value; /* the minimal value, undefined if cardinality is zero */ |
40 | uint64_t sum_value; /* the sum of all values (could be used to compute |
41 | average) */ |
42 | |
43 | uint64_t cardinality; /* total number of values stored in the bitmap */ |
44 | |
45 | // and n_values_arrays, n_values_rle, n_values_bitmap |
46 | } roaring_statistics_t; |
47 | |
48 | #endif /* ROARING_TYPES_H */ |
49 | |