open_address_file_hash_dictionary_handler.h
Go to the documentation of this file.
1 /******************************************************************************/
35 /******************************************************************************/
36 
37 #if !defined(OPEN_ADDRESS_FILE_DICTIONARY_HANDLER_H_)
38 #define OPEN_ADDRESS_FILE_DICTIONARY_HANDLER_H_
39 
40 #if defined(__cplusplus)
41 extern "C" {
42 #endif
43 
44 #include "../dictionary_types.h"
45 #include "./../dictionary.h"
46 #include "../../key_value/kv_system.h"
47 #include "open_address_file_hash.h"
49 
50 /*edefines file operations for arduino */
51 #include "../../file/sd_stdio_c_iface.h"
52 
56 typedef struct oaf_dictionary {
57  /* what needs to go in here? */
62 
66 /*typedef struct oadict_cursor
67 {
68  ion_hash_t first; *<First visited spot
69  ion_hash_t current; *<Currently visited spot
70  ion_cursor_status_t status; *<Status of last cursor call
71 } ion_oadict_cursor_t;*/
72 
73 /*
74 typedef struct equality_cursor
75 {
76  ion_dict_cursor_t super;
77  *< Cursor supertype this type inherits from.
78 
79 }ion_equality_cursor_t;
80 */
81 
89 typedef struct oafdict_equality_cursor {
93 
94  ion_boolean_t (*equal)(
96  ion_key_t,
97  ion_key_t
98  );
101 
112 void
114  ion_dictionary_handler_t *handler
115 );
116 
131  ion_key_t key,
132  ion_value_t value
133 );
134 
159 ion_err_t
162  ion_key_type_t key_type,
163  ion_key_size_t key_size,
164  ion_value_size_t value_size,
165  ion_dictionary_size_t dictionary_size,
166  ion_dictionary_compare_t compare,
167  ion_dictionary_handler_t *handler,
169 );
170 
184  ion_key_t key
185 );
186 
194 ion_err_t
197 );
198 
206 ion_err_t
209 );
210 
228  ion_key_t key,
229  ion_value_t value
230 );
231 
255 int
257  ion_key_t first_key,
258  ion_key_t second_key
259 );
260 
269 /*ion_err_t
270 oadict_next(
271  ion_dict_cursor_t *cursor,
272  ion_value_t *value
273 );*/
274 
287 void
289  ion_dict_cursor_t **cursor
290 );
291 
292 #if defined(__cplusplus)
293 }
294 #endif
295 
296 #endif /* OPEN_ADDRESS_FILE_DICTIONARY_HANDLER_H_ */
enum ION_KEY_TYPE ion_key_type_t
This is the available key types for ION_DB. All types will be based on system defines.
int ion_value_size_t
The size (length) of a dictionary value in bytes.
Definition: kv_system.h:256
unsigned int ion_dictionary_id_t
A type used to identify dictionaries, specifically in the master table.
unsigned int ion_dictionary_size_t
The implementation specific size of the dictionary.
Definition: kv_system.h:264
#define key(k)
Definition: bpp_tree.c:75
struct oaf_dictionary ion_oaf_dictionary_t
Struct used to for instance of a given dictionary.
char(* ion_dictionary_compare_t)(ion_key_t, ion_key_t, ion_key_size_t)
Function pointer type for dictionary comparison methods.
char ion_err_t
The error type used to store error codes.
Definition: kv_system.h:226
void * ion_key_t
A dictionary key.
Definition: kv_system.h:241
void oafdict_destroy_cursor(ion_dict_cursor_t **cursor)
Next function to query and retrieve the next <K,V> that stratifies the predicate of the cursor...
Struct used to for instance of a given dictionary.
void * ion_value_t
A dictionary value.
Definition: kv_system.h:246
ion_status_t oafdict_insert(ion_dictionary_t *dictionary, ion_key_t key, ion_value_t value)
Inserts a key and value into the dictionary.
A dictionary contains information regarding an instance of the storage element and the associated han...
ion_err_t oafdict_destroy_dictionary(ion_dictionary_id_t id)
Cleans up all files created by the dictionary, and frees any allocated memory, for an already closed ...
A supertype for dictionary cursor objects.
This file includes common components for oadictionary and oahash.
ion_err_t oafdict_create_dictionary(ion_dictionary_id_t id, ion_key_type_t key_type, ion_key_size_t key_size, ion_value_size_t value_size, ion_dictionary_size_t dictionary_size, ion_dictionary_compare_t compare, ion_dictionary_handler_t *handler, ion_dictionary_t *dictionary)
Creates an instance of a dictionary.
Cursor for dictionary specific implementations.
A hash table using linear probing. Designed for in memory use.
int oafdict_compare(ion_key_t first_key, ion_key_t second_key)
Compares two key and returns the difference.
ion_err_t oafdict_delete_dictionary(ion_dictionary_t *dictionary)
Deletes an instance of the dictionary and associated data.
int ion_key_size_t
The size (length) of a dictionary key in bytes.
Definition: kv_system.h:251
char ion_boolean_t
A boolean type.
Definition: kv_system.h:269
struct oafdict_equality_cursor ion_oafdict_equality_cursor_t
Cursor for dictionary specific implementations.
void oafdict_init(ion_dictionary_handler_t *handler)
Registers a specific handler for a dictionary instance.
ion_status_t oafdict_delete(ion_dictionary_t *dictionary, ion_key_t key)
Deletes the key and assoicated value from the dictionary instance.
Struct used to maintain an instance of an in memory hashmap.
A dictionary_handler is responsible for dealing with the specific interface for an underlying diction...
ion_status_t oafdict_update(ion_dictionary_t *dictionary, ion_key_t key, ion_value_t value)
Updates the value for a given key.
A status object that describes the result of a dictionary operation.
Definition: kv_system.h:290