X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/113597e3c369b18fa4e73a0b9744398a0e9e0a79..e642d903800bc569707379b4a7f48293077d3c99:/src/btree.h diff --git a/src/btree.h b/src/btree.h index 95180b0..06a6941 100644 --- a/src/btree.h +++ b/src/btree.h @@ -50,6 +50,7 @@ #include "common.h" #include "clave.h" #include "clave_fija.h" +#include "btree_data.h" /* alias para codear menos :) */ @@ -92,15 +93,18 @@ class BTree { void DelKey (const Clave &k); private: - void write_tree_header (); - void write_block (uchar *block, uint num); + Clave* AddKeyR (const Clave *k, uint node_num); + void WriteFileHeader (); + + void WriteBlock (uchar *block, uint num); uchar *ReadBlock (uint num); void ReadNodoHeader (uchar *node, BTreeNodeHeader *header); void WriteNodoHeader (uchar *node, BTreeNodeHeader *header); - std::list ReadKeys (uchar *node, BTreeNodeHeader &node_header); + std::list ReadKeys (uchar *node, BTreeNodeHeader &node_header); + void WriteKeys (uchar *node, BTreeNodeHeader &node_header, std::list &keys); std::string filename; BTreeFileHeader header; @@ -110,6 +114,10 @@ class BTree { * \TODO Ver si vale la pena */ FILE *fp; + + + /* DEBUG */ + void PrintNode (uint num); }; #endif // _B_TREE_H