dictionary_types.h
Go to the documentation of this file.
1 /******************************************************************************/
36 /******************************************************************************/
37 
38 #if !defined(DICTIONARY_TYPES_H_)
39 #define DICTIONARY_TYPES_H_
40 
41 #if defined(__cplusplus)
42 extern "C" {
43 #endif
44 
45 #include "../key_value/kv_system.h"
46 
51 typedef unsigned int ion_dictionary_id_t;
52 
60 
64 typedef int ion_hash_t;
65 
73 
79 
83 typedef char (*ion_dictionary_compare_t)(
84  ion_key_t,
85  ion_key_t,
87 );
88 
94 
99 typedef struct predicate ion_predicate_t;
100 
106 
112 
116 typedef enum ION_COMPARISON {
117  A_lt_B = -1,
118  A_equ_B = 0,
119  A_gt_B = 1
121 
150 };
151 
157 typedef char ion_cursor_status_t;
158 
171 };
172 
178 
183 typedef struct {
184  ion_dictionary_id_t id;
186  ion_dict_use_t use_type;
198  ion_dictionary_status_t dictionary_status;
201 
208  ion_status_t (*insert)(
210  ion_key_t,
212  );
214  ion_err_t (*create_dictionary)(
223  );
225  ion_status_t (*get)(
227  ion_key_t,
229  );
231  ion_status_t (*update)(
233  ion_key_t,
235  );
237  ion_err_t (*find)(
239  ion_predicate_t *,
241  );
243  ion_status_t (*remove)(
245  ion_key_t
246  );
248  ion_err_t (*delete_dictionary)(
250  );
252  ion_err_t (*destroy_dictionary)(
253  ion_dictionary_id_t id
254  );
256  ion_err_t (*open_dictionary)(
257  ion_dictionary_handler_t *,
261  );
263  ion_err_t (*close_dictionary)(
264  ion_dictionary_t *
265  );
267 };
268 
273 struct dictionary {
274  ion_dictionary_status_t status;
280 };
281 
290  ion_dictionary_id_t id;
292 };
293 
297 typedef char ion_predicate_type_t;
298 
309 };
310 
315 typedef struct equality_statement {
316  ion_key_t equality_value;
319 
324 typedef struct range_statement {
325  ion_key_t lower_bound;
327  ion_key_t upper_bound;
330 
337  char unused;
339 
346  char unused;
348 
362 };
363 
376 struct predicate {
378  ion_predicate_type_t type;
381 
384  void (*destroy)(
385  ion_predicate_t **
386  );
387 };
388 
399  ion_cursor_status_t status;
408  );
411  void (*destroy)(
413  );
417 };
418 
434 };
435 
440 typedef char ion_write_concern_t;
441 
445 typedef struct hash_bucket {
446  char status;
447  ion_byte_t data[];
449 
455 );
456 
457 #if defined(__cplusplus)
458 }
459 #endif
460 
461 #endif /* DICTIONARY_TYPES_H_ */
int ion_hash_t
The position in the hashmap.
unsigned char ion_byte_t
A byte type.
Definition: kv_system.h:232
char ion_predicate_type_t
A type for storing predicate type data.
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.
ion_record_info_t record
ion_byte_t ion_dict_use_t
A type describing how a dictionary is used.
ION_PREDICATE_TYPE
The predicate type flag list.
ion_predicate_t * predicate
ion_dictionary_type_t dictionary_type
ION_DICTIONARY_STATUS
The status codes describing various states a dictionary can be in.
int ion_value_size_t
The size (length) of a dictionary value in bytes.
Definition: kv_system.h:256
#define next(b)
Definition: bpp_tree.c:82
struct ion_all_records_statement ion_all_records_statement_t
Predicate type for cursors that iterate over all records in set.
This is used to pass predicate into a cursor-based query over a dictionary.
ion_predicate_statement_t statement
ion_dictionary_handler_t * handler
ion_dictionary_parent_t * instance
enum ION_DICTIONARY_TYPE ion_dictionary_type_t
This is the available dictionary types for ION_DB. All types will be based on system defines...
ion_dictionary_t * dictionary
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
Struct containing details for opening a dictionary previously created.
ion_cursor_status_t status
This is a predicate data object for range queries.
ion_dictionary_status_t dictionary_status
This is the super type for all dictionaries.
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_all_records_statement_t all_records
char ion_dictionary_status_t
A short status describing the current status of a dictionary.
void * ion_key_t
A dictionary key.
Definition: kv_system.h:241
ion_equality_statement_t equality
void * ion_value_t
A dictionary value.
Definition: kv_system.h:246
struct range_statement ion_range_statement_t
This is a predicate data object for range queries.
Struct used to maintain individual records in the hashmap.
ION_WRITE_CONCERN
The list of write concern options for supported dictionary implementations.
A dictionary contains information regarding an instance of the storage element and the associated han...
Predicate type for cursors that iterate over all records in set.
void(* ion_handler_initializer_t)(ion_dictionary_handler_t *)
Function signature for all init functions.
ION_COMPARISON
A comparison result type that describes the result of a comparison.
ion_predicate_type_t type
ion_dictionary_id_t id
enum ION_COMPARISON ion_comparsion_t
A comparison result type that describes the result of a comparison.
A supertype for dictionary cursor objects.
ION_CURSOR_STATUS
A status type describing the current state of an initialized cursor.
A supertype for cursor predicate objects.
ion_dictionary_type_t type
This is a predicate data object for equality queries.
ion_key_type_t key_type
struct hash_bucket ion_hash_bucket_t
Struct used to maintain individual records in the hashmap.
Predicate type for predicate (conditional) queries.
ion_dictionary_compare_t compare
ion_other_predicate_statement_t other_predicate
ion_dictionary_size_t dictionary_size
struct other_predicate_statement ion_other_predicate_statement_t
Predicate type for predicate (conditional) queries.
char ion_write_concern_t
A type for write concern information used by hash table based dictionaries which limit insert/update ...
int ion_key_size_t
The size (length) of a dictionary key in bytes.
Definition: kv_system.h:251
struct equality_statement ion_equality_statement_t
This is a predicate data object for equality queries.
ion_range_statement_t range
Struct used to maintain information about size of key and value.
Definition: kv_system.h:306
ion_dictionary_status_t status
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