Beast - Music Synthesizer and Composer  0.11.1+10.g2da35
sfiustore.hh
Go to the documentation of this file.
1  // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
2 #ifndef __SFI_USTORE_H__
3 #define __SFI_USTORE_H__
4 
5 #include <sfi/sfitypes.hh>
6 
7 
8 /* --- typedefs --- */
9 /* typedef struct _SfiUStore SfiUStore; */
10 /* typedef struct _SfiUPool SfiUPool; */
11 typedef gboolean (*SfiUStoreForeach) (gpointer data,
12  gulong unique_id,
13  gpointer value);
14 typedef gboolean (*SfiUPoolForeach) (gpointer data,
15  gulong unique_id);
16 typedef gboolean (*SfiPPoolForeach) (gpointer data,
17  gpointer pointer);
18 
19 
20 /* --- unique ID store --- */
21 SfiUStore* sfi_ustore_new (void);
22 gpointer sfi_ustore_lookup (SfiUStore *store,
23  gulong unique_id);
24 void sfi_ustore_insert (SfiUStore *store,
25  gulong unique_id,
26  gpointer value);
27 void sfi_ustore_remove (SfiUStore *store,
28  gulong unique_id);
29 void sfi_ustore_foreach (SfiUStore *store,
30  SfiUStoreForeach foreach,
31  gpointer data);
32 void sfi_ustore_destroy (SfiUStore *store);
33 
34 
35 /* --- unique ID pool --- */
36 SfiUPool* sfi_upool_new (void);
37 gboolean sfi_upool_lookup (SfiUPool *pool,
38  gulong unique_id);
39 void sfi_upool_set (SfiUPool *pool,
40  gulong unique_id);
41 void sfi_upool_unset (SfiUPool *pool,
42  gulong unique_id);
43 void sfi_upool_foreach (SfiUPool *pool,
44  SfiUPoolForeach foreach,
45  gpointer data);
46 void sfi_upool_destroy (SfiUPool *pool);
47 gulong* sfi_upool_list (SfiUPool *pool,
48  guint *n_ids);
49 
50 
51 /* --- pointer pool --- */
52 SfiPPool* sfi_ppool_new (void);
53 gboolean sfi_ppool_lookup (SfiPPool *pool,
54  gpointer unique_ptr);
55 void sfi_ppool_set (SfiPPool *pool,
56  gpointer unique_ptr);
57 void sfi_ppool_unset (SfiPPool *pool,
58  gpointer unique_ptr);
59 void sfi_ppool_foreach (SfiPPool *pool,
60  SfiPPoolForeach foreach,
61  gpointer data);
62 GSList* sfi_ppool_slist (SfiPPool *pool);
63 void sfi_ppool_destroy (SfiPPool *pool);
64 
65 
66 
67 #endif /* __SFI_USTORE_H__ */
68 
69 /* vim:set ts=8 sts=2 sw=2: */