X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/ce24e1d22d120e6613f3cd1e04d81135f3d048c9..HEAD:/src/btree_data.h diff --git a/src/btree_data.h b/src/btree_data.h index 027c595..b7f457a 100644 --- a/src/btree_data.h +++ b/src/btree_data.h @@ -46,12 +46,12 @@ class BTreeData { virtual uchar *ToArray () const; /** Retorna la clave manejada */ - Clave* getClave () { return clave; } - void setClave (Clave *k) { clave = k; } + Clave* GetKey () { return clave; } + void SetKey (Clave *k) { clave = k; } /** Retorna el hijo apuntado */ - uint getChild () { return hijo; } + uint GetChild () { return hijo; } /** Setea el hijo apuntado */ - void setChild (uint c) { hijo = c; } + void SetChild (uint c) { hijo = c; } bool Abrev (BTreeData *anterior); bool DesAbrev (BTreeData *anterior); @@ -61,10 +61,10 @@ class BTreeData { virtual operator std::string () const { std::string out = (*clave); std::stringstream ss; - ss << "(" << out ; + ss << "("; + ss << out; ss << ")" << "[" << hijo << "]"; - ss >> out; - return out; + return ss.str (); } protected: Clave *clave; @@ -74,7 +74,7 @@ class BTreeData { /** Dato a guardar en las hojas */ class BTreeLeafData:public BTreeData { public: - BTreeLeafData (Clave *k) { clave = k; } + BTreeLeafData (Clave *k) { clave = k; hijo = 0; } BTreeLeafData (uchar *node, int key_type); virtual ~BTreeLeafData (); @@ -96,6 +96,7 @@ class BTreeChildData:public BTreeData { virtual uint Size () const; virtual uchar *ToArray () const; + bool operator < (const BTreeData &data) const; virtual operator std::string () const { std::string out; std::stringstream ss;