CAEN Utility  2.0.2
Utilities for CAEN projects
CAENMapTypes.h
Go to the documentation of this file.
1 /******************************************************************************
2 *
3 * CAEN SpA - Software Division
4 * Via Vetraia, 11 - 55049 - Viareggio ITALY
5 * +39 0594 388 398 - www.caen.it
6 *
7 *******************************************************************************
8 *
9 * Copyright (C) 2014 rxi
10 *
11 * This file is part of the CAEN Utility.
12 *
13 * This file is distributed under the MIT License.
14 *
15 * SPDX-License-Identifier: MIT
16 *
17 ***************************************************************************/
25 #ifndef CAEN_INCLUDE_TYPES_CAENMAPTYPES_H_
26 #define CAEN_INCLUDE_TYPES_CAENMAPTYPES_H_
27 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 #include <stdlib.h>
41 #include <stdbool.h>
42 
43 /***************************
44 * Types
45 ***************************/
46 struct c_map_node_t;
47 typedef struct c_map_node_t c_map_node_t;
48 
50 typedef struct {
52  size_t nbuckets;
53  size_t nnodes;
55 } c_map_base_t;
56 
58 typedef struct {
59  size_t bucketidx;
61 } c_map_iter_t;
62 
69 #define c_map_t(T) struct { c_map_base_t base; T *ref; T tmp; }
70 
71 #ifdef __cplusplus
72 }
73 #endif
74 
75 #endif // CAEN_INCLUDE_TYPES_CAENMAPTYPES_H_
Base type for maps.
Definition: CAENMapTypes.h:50
size_t bucketidx
Definition: CAENMapTypes.h:59
size_t nnodes
Definition: CAENMapTypes.h:53
Iterator.
Definition: CAENMapTypes.h:58
c_map_node_t ** buckets
Definition: CAENMapTypes.h:51
size_t nbuckets
Definition: CAENMapTypes.h:52
bool initialized
Definition: CAENMapTypes.h:54
c_map_node_t * node
Definition: CAENMapTypes.h:60