From 681835993486168a113f7cc81593f738c736f4df Mon Sep 17 00:00:00 2001 From: Ricardo Markiewicz Date: Thu, 27 Oct 2005 23:48:32 +0000 Subject: [PATCH] Agrego atributo de tipo de arbol. --- src/btree.cpp | 3 ++- src/btree.h | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/btree.cpp b/src/btree.cpp index 5b1c36d..9fece76 100644 --- a/src/btree.cpp +++ b/src/btree.cpp @@ -1,9 +1,10 @@ #include "btree.h" -BTree::BTree (const std::string &name, unsigned int block_size, int kt, bool create_new_file) +BTree::BTree (const std::string &name, unsigned int block_size, int tt, int kt, bool create_new_file) { key_type = kt; + tree_type = tt; uchar *node; BTreeNodeHeader nh; diff --git a/src/btree.h b/src/btree.h index f888eea..7d64072 100644 --- a/src/btree.h +++ b/src/btree.h @@ -121,7 +121,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 +130,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. */ @@ -182,6 +187,7 @@ class BTree { std::string filename; BTreeFileHeader header; int key_type; + int tree_type; /** Apunta al archivo de datos, asi se abre solo 1 vez * -- 2.43.0