X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/6d948f6bdab2bb66cd5eb8046ec67ca9b3ab76c1..3a9e92af5fe004d068e161c66e308e4401dfc21b:/src/btree.h?ds=sidebyside diff --git a/src/btree.h b/src/btree.h index 081c436..9dbfc54 100644 --- a/src/btree.h +++ b/src/btree.h @@ -46,8 +46,10 @@ #include #include +#include #include "common.h" #include "clave.h" +#include "clave_fija.h" /* alias para codear menos :) */ @@ -86,8 +88,8 @@ class BTree { BTree (const std::string &filename, unsigned int block_size, bool create_new_file = false); ~BTree (); - void AddKey (Clave &k); - void DelKey (Clave &k); + void AddKey (const Clave &k); + void DelKey (const Clave &k); private: void write_tree_header (); @@ -98,6 +100,9 @@ class BTree { void ReadNodoHeader (uchar *node, BTreeNodeHeader *header); void WriteNodoHeader (uchar *node, BTreeNodeHeader *header); + std::list ReadKeys (uchar *node, BTreeNodeHeader &node_header); + void WriteKeys (uchar *node, BTreeNodeHeader &node_header, std::list &keys); + std::string filename; BTreeFileHeader header;