open_address_hash_dictionary_handler.h
Go to the documentation of this file.
1 /******************************************************************************/
35 /******************************************************************************/
36 
37 #if !defined(OPEN_ADDRESS_DICTIONARY_HANDLER_H_)
38 #define OPEN_ADDRESS_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_hash.h"
49 
53 typedef struct oa_dictionary {
54  /* what needs to go in here? */
59 
67 typedef struct oadict_equality_cursor {
71 
72  ion_boolean_t (*equal)(
74  ion_key_t,
75  ion_key_t
76  );
79 
90 void
93 );
94 
109  ion_key_t key,
110  ion_value_t value
111 );
112 
137 ion_err_t
140  ion_key_type_t key_type,
141  ion_key_size_t key_size,
142  ion_value_size_t value_size,
143  ion_dictionary_size_t dictionary_size,
144  ion_dictionary_compare_t compare,
145  ion_dictionary_handler_t *handler,
147 );
148 
162  ion_key_t key
163 );
164 
172 ion_err_t
175 );
176 
184 ion_err_t
187 );
188 
206  ion_key_t key,
207  ion_value_t value
208 );
209 
233 int
235  ion_key_t first_key,
236  ion_key_t second_key
237 );
238 
247 /*ion_err_t
248 oadict_next(
249  ion_dict_cursor_t *cursor,
250  ion_value_t *value
251 );*/
252 
264  ion_dict_cursor_t *cursor,
265  ion_record_t *record
266 );
267 
282  ion_dictionary_t *dict,
283  ion_key_t key1,
284  ion_key_t key2
285 );
286 
299 void
301  ion_dict_cursor_t **cursor
302 );
303 
304 #if defined(__cplusplus)
305 }
306 #endif
307 
308 #endif /* OPEN_ADDRESS_DICTIONARY_HANDLER_H_ */
ion_status_t oadict_delete(ion_dictionary_t *dictionary, ion_key_t key)
Deletes the key and assoicated value from the dictionary instance.
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.
Struct used to maintain an instance of an in memory hashmap.
int ion_value_size_t
The size (length) of a dictionary value in bytes.
Definition: kv_system.h:256
A hash table using linear probing. Designed for in memory use.
void oadict_destroy_cursor(ion_dict_cursor_t **cursor)
Destroys the cursor.
ion_cursor_status_t oadict_next(ion_dict_cursor_t *cursor, ion_record_t *record)
Next function to query and retrieve the next <K,V> that stratifies the predicate of the cursor...
int oadict_compare(ion_key_t first_key, ion_key_t second_key)
Compares two key and returns the difference.
Struct used to maintain key and value.
Definition: kv_system.h:315
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
void oadict_init(ion_dictionary_handler_t *handler)
Registers a specific handler for a dictionary instance.
#define key(k)
Definition: bpp_tree.c:75
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
ion_err_t oadict_delete_dictionary(ion_dictionary_t *dictionary)
Deletes an instance of the dictionary and associated data.
void * ion_key_t
A dictionary key.
Definition: kv_system.h:241
void * ion_value_t
A dictionary value.
Definition: kv_system.h:246
A dictionary contains information regarding an instance of the storage element and the associated han...
struct oadict_equality_cursor ion_oadict_equality_cursor_t
Dictionary cursor for equality queries.
A supertype for dictionary cursor objects.
ion_err_t oadict_destroy_dictionary(ion_dictionary_id_t id)
Cleans up all files created by the dictionary, and frees any allocated memory, for an already closed ...
Struct used to for instance of a given dictionary.
ion_status_t oadict_insert(ion_dictionary_t *dictionary, ion_key_t key, ion_value_t value)
Inserts a key and value into the dictionary.
ion_err_t oadict_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.
ion_boolean_t oadict_is_equal(ion_dictionary_t *dict, ion_key_t key1, ion_key_t key2)
Compares two keys and determines if they are equal assuming that they are equal is length (in size)...
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
This file includes common components for oadictionary and oahash.
Dictionary cursor for equality queries.
struct oa_dictionary ion_oa_dictionary_t
Struct used to for instance of a given dictionary.
ion_status_t oadict_update(ion_dictionary_t *dictionary, ion_key_t key, ion_value_t value)
Updates the value for a given key.
A dictionary_handler is responsible for dealing with the specific interface for an underlying diction...
char ion_cursor_status_t
A type for the status of a cursor.
A status object that describes the result of a dictionary operation.
Definition: kv_system.h:290