OpenAddressFileHash.h
Go to the documentation of this file.
1 /******************************************************************************/
36 /******************************************************************************/
37 
38 #ifndef PROJECT_OPENADDRESSFILEHASH_H
39 #define PROJECT_OPENADDRESSFILEHASH_H
40 
41 #include "Dictionary.h"
42 #include "../key_value/kv_system.h"
43 #include "../dictionary/open_address_file_hash/open_address_file_hash_dictionary_handler.h"
44 
45 template<typename K, typename V>
46 class OpenAddressFileHash:public Dictionary<K, V> {
47 public:
48 
72  ion_dictionary_size_t dictionary_size
73 ) {
74  oafdict_init(&this->handler);
75 
76  this->initializeDictionary(id, key_type, key_size, value_size, dictionary_size);
77 }
78 
81 ) {
82  oafdict_init(&this->handler);
83 
84  this->open(config);
85 }
86 
89  ion_dictionary_config_info_t config_info,
90  K key_type,
91  V value_type
92 ) {
93  UNUSED(key_type);
94  UNUSED(value_type);
95 
96  return new OpenAddressFileHash<K, V>(config_info);
97 }
98 };
99 
100 #endif /* PROJECT_OPENADDRESSFILEHASH_H */
ion_key_type_t key_type
Definition: Dictionary.h:54
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.
OpenAddressFileHash(ion_dictionary_config_info_t config)
int ion_value_size_t
The size (length) of a dictionary value in bytes.
Definition: kv_system.h:256
OpenAddressFileHash(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)
Registers a specific open address file hash dictionary instance.
ion_value_size_t value_size
Definition: Dictionary.h:56
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_err_t open(ion_dictionary_config_info_t config_info)
Opens a dictionary, given the desired config.
Definition: Dictionary.h:230
ion_key_size_t key_size
Definition: Dictionary.h:55
void oafdict_init(ion_dictionary_handler_t *handler)
Registers a specific handler for a dictionary instance.
#define UNUSED(x)
Definition: kv_system.h:102
ion_dictionary_handler_t handler
Definition: Dictionary.h:52
static OpenAddressFileHash< K, V > * openDictionary(ion_dictionary_config_info_t config_info, K key_type, V value_type)
Interface describing how user interacts with general dictionaries using C++.
int ion_key_size_t
The size (length) of a dictionary key in bytes.
Definition: kv_system.h:251
ion_err_t initializeDictionary(ion_dictionary_id_t dict_id, ion_key_type_t k_type, ion_key_size_t k_size, ion_value_size_t v_size, ion_dictionary_size_t dictionary_size)
Creates a dictionary with a specific identifier (for use through the master table).
Definition: Dictionary.h:85