X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/78d8bc6c001cb877d8c7daf3868835815a97ce21..52d9e098f15ad0ca70f11b4549f3d55f55a22a83:/src/btree_data.h diff --git a/src/btree_data.h b/src/btree_data.h index 5b6a9f6..44a3a77 100644 --- a/src/btree_data.h +++ b/src/btree_data.h @@ -10,19 +10,32 @@ /** Dato a guardar en los nodos */ class BTreeData { public: + BTreeData () { clave = NULL; } BTreeData (uchar *node); virtual ~BTreeData (); virtual uint Size (); virtual uchar *ToArray (); + + Clave* getClave () { return clave; } + + bool operator < (const BTreeData &data) const; + virtual operator std::string () const { + if (clave) { + return (*clave); + } + return "NoKey"; + } protected: Clave *clave; - uint hijo_izquierdo; + uint hijo; }; /** Dato a guardar en las hojas */ -class BTreeLeafData:BTreeData { +class BTreeLeafData:public BTreeData { public: + BTreeLeafData (Clave *k):BTreeData () { clave = k; } + BTreeLeafData (uchar *node) { clave = new ClaveFija (node); } virtual ~BTreeLeafData (); virtual uint Size ();