X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/78d8bc6c001cb877d8c7daf3868835815a97ce21..88f6f1c9a8861bed8d1907001a10c4605e268a5e:/src/btree.h diff --git a/src/btree.h b/src/btree.h index b001bef..999d798 100644 --- a/src/btree.h +++ b/src/btree.h @@ -92,17 +92,20 @@ class BTree { void AddKey (const Clave &k); void DelKey (const Clave &k); - private: + protected: + Clave* AddKeyR (const Clave *k, uint node_num, uint &left_child, uint &right_child); + void WriteFileHeader (); void WriteBlock (uchar *block, uint num); uchar *ReadBlock (uint num); + uchar *NewBlock (uint &num); 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::list ReadKeys (uchar *node, BTreeNodeHeader &node_header); + void WriteKeys (uchar *node, BTreeNodeHeader &node_header, std::list &keys); std::string filename; BTreeFileHeader header; @@ -112,6 +115,10 @@ class BTree { * \TODO Ver si vale la pena */ FILE *fp; + + + /* DEBUG */ + void PrintNode (uint num); }; #endif // _B_TREE_H