X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/ea7b8df3fe6725846831da271c70d0b77eecfe55..e642d903800bc569707379b4a7f48293077d3c99:/src/btree_data.h?ds=sidebyside diff --git a/src/btree_data.h b/src/btree_data.h index d920c9f..c1d4261 100644 --- a/src/btree_data.h +++ b/src/btree_data.h @@ -10,12 +10,21 @@ /** Dato a guardar en los nodos */ class BTreeData { public: - BTreeData () {} + BTreeData () { clave = NULL; } BTreeData (uchar *node); virtual ~BTreeData (); virtual uint Size (); virtual uchar *ToArray (); + + + bool operator < (const BTreeData &data) const; + virtual operator std::string () const { + if (clave) { + return (*clave); + } + return "NoKey"; + } protected: Clave *clave; uint hijo; @@ -25,6 +34,7 @@ class BTreeData { class BTreeLeafData:public BTreeData { public: BTreeLeafData (Clave *k):BTreeData () { clave = k; } + BTreeLeafData (uchar *node) { clave = new ClaveFija (node); } virtual ~BTreeLeafData (); virtual uint Size ();