X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/e8d57487222c69de978d1fd09b6791ae0e4d02ef..57dbb7df8973a3e0c0c570c1eae9d84802e02bd9:/src/btree.h?ds=sidebyside diff --git a/src/btree.h b/src/btree.h index 61fbb8c..ef9f242 100644 --- a/src/btree.h +++ b/src/btree.h @@ -73,6 +73,7 @@ #include "clave_fija.h" #include "clave_variable.h" #include "btree_data.h" +#include "exception.h" /* alias para codear menos :) */ @@ -121,7 +122,7 @@ struct BTreeFindResult { */ class BTree { public: - BTree (const std::string &filename, unsigned int block_size, int k_t = KEY_FIXED, bool create_new_file = false); + BTree (const std::string &filename, unsigned int block_size, int t_t = TYPE_UNIQUE, int k_t = KEY_FIXED, bool create_new_file = false); ~BTree (); /** Tipos de clave a usar */ @@ -130,6 +131,11 @@ class BTree { KEY_VARIABLE /**< Utilización de clave de longitud variable */ }; + enum { + TYPE_UNIQUE, + TYPE_SELECTIVE + }; + /** Agrega una nueva clave al árbol. */ void AddKey (const Clave &k); /** Elimina una clave del árbol. */ @@ -175,9 +181,14 @@ class BTree { void WriteKeys (uchar *node, BTreeNodeHeader &node_header, std::list &keys); void DeleteKeys (std::list &keys); + /* Abreviacion de Claves */ + void AbrevKey (std::list &lst); + void DeAbrevKey (std::list &lst); + std::string filename; BTreeFileHeader header; int key_type; + int tree_type; /** Apunta al archivo de datos, asi se abre solo 1 vez *