BppTree.h
Go to the documentation of this file.
1 /******************************************************************************/
35 /******************************************************************************/
36 
37 #if !defined(PROJECT_BPPTREE_H)
38 #define PROJECT_BPPTREE_H
39 
40 #include "Dictionary.h"
41 #include "../key_value/kv_system.h"
42 #include "../dictionary/bpp_tree/bpp_tree_handler.h"
43 
44 template<typename K, typename V>
45 class BppTree:public Dictionary<K, V> {
46 public:
65  int key_size,
66  int value_size
67 ) {
68  bpptree_init(&this->handler);
69 
70  this->initializeDictionary(id, key_type, key_size, value_size, 0);
71 }
72 
75 ) {
76  bpptree_init(&this->handler);
77 
78  this->open(config);
79 }
80 
81 static BppTree<K, V> *
83  ion_dictionary_config_info_t config_info,
84  K key_type,
85  V value_type
86 ) {
87  UNUSED(key_type);
88  UNUSED(value_type);
89 
90  return new BppTree<K, V>(config_info);
91 }
92 };
93 
94 #endif /* PROJECT_BPPTREE_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.
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.
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
BppTree(ion_dictionary_id_t id, ion_key_type_t key_type, int key_size, int value_size)
Registers a specific B+ tree dictionary instance.
Definition: BppTree.h:62
BppTree(ion_dictionary_config_info_t config)
Definition: BppTree.h:73
ion_key_size_t key_size
Definition: Dictionary.h:55
void bpptree_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
Interface describing how user interacts with general dictionaries using C++.
static BppTree< K, V > * openDictionary(ion_dictionary_config_info_t config_info, K key_type, V value_type)
Definition: BppTree.h:82
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