#include "common.h"
#include "clave.h"
#include "clave_fija.h"
+#include "clave_variable.h"
#include "btree_data.h"
/* alias para codear menos :) */
*/
class BTree {
public:
- BTree (const std::string &filename, unsigned int block_size, bool create_new_file = false);
+ BTree (const std::string &filename, unsigned int block_size, int k_t = KEY_FIXED, bool create_new_file = false);
~BTree ();
+ /** Tipos de clave a usar */
+ enum {
+ KEY_FIXED,
+ KEY_VARIABLE
+ };
+
void AddKey (const Clave &k);
void DelKey (const Clave &k);
protected:
Clave* AddKeyR (const Clave *k, uint node_num, uint &left_child, uint &right_child);
+ Clave* AddKeyOtherR (const Clave *k, uint node_num, uint &left_child, uint &right_child);
+ Clave* AddKeyLeafR (const Clave *k, uint node_num, uint &left_child, uint &right_child);
void WriteFileHeader ();
std::string filename;
BTreeFileHeader header;
+ int key_type;
/** Apunta al archivo de datos, asi se abre solo 1 vez
*