globus_common  17.9
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
globus_object_cache.h
Go to the documentation of this file.
1 
7 #ifndef GLOBUS_OBJECT_CACHE_H
8 #define GLOBUS_OBJECT_CACHE_H
9 
10 #include "globus_common_include.h"
11 #include "globus_fifo.h"
12 #include "globus_list.h"
13 #include "globus_hashtable.h"
14 
15 #include "globus_object.h"
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 /**********************************************************************
22  * Object Cache API Types
23  * globus_object_cache_t -- container
24  **********************************************************************/
25 
26 typedef struct globus_object_cache_s {
27  globus_hashtable_t handlemap;
28  globus_fifo_t handles; /* in case we add a cache list function */
29  unsigned long capacity_limit;
30  unsigned long entry_count;
31 } globus_object_cache_t;
32 
33 
34 /**********************************************************************
35  * Object Cache API
36  **********************************************************************/
37 
38 extern void
39 globus_object_cache_init (globus_object_cache_t * cache);
40 /* does nothing if cache is NULL */
41 
42 extern void
43 globus_object_cache_destroy (globus_object_cache_t * cache);
44 /* does nothing if cache is NULL */
45 
46 extern void
47 globus_object_cache_insert (globus_object_cache_t * cache,
48  void * new_handle,
49  globus_object_t * new_object);
50 /* does nothing if cache is NULL, or new_handle is already mapped in cache,
51  * or new_object is NULL */
52 
53 extern globus_object_t *
54 globus_object_cache_lookup (globus_object_cache_t * cache,
55  void * handle);
56 /* returns object stored in cache with handle, or
57  * returns NULL if not mapped or if cache is NULL */
58 
59 extern globus_object_t *
60 globus_object_cache_remove (globus_object_cache_t * cache,
61  void * handle);
62 /* returns object removed from cache with handle, or
63  * returns NULL if not mapped or if cache is NULL */
64 
65 extern globus_fifo_t *
66 globus_object_cache_list (globus_object_cache_t * cache);
67 /* returns fifo containing existing handles in order inserted, or
68  * returns NULL if cache is NULL */
69 
70 
71 #ifdef __cplusplus
72 }
73 #endif
74 
75 #endif /* GLOBUS_OBJECT_CACHE_H */
Linked List.
struct globus_fifo_s * globus_fifo_t
Definition: globus_fifo.h:33
Hash Table.
Globus FIFO.
Include System Headers.