X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/78d8bc6c001cb877d8c7daf3868835815a97ce21..e642d903800bc569707379b4a7f48293077d3c99:/src/btree_data.cpp?ds=sidebyside diff --git a/src/btree_data.cpp b/src/btree_data.cpp index 5e351ce..dd6f709 100644 --- a/src/btree_data.cpp +++ b/src/btree_data.cpp @@ -9,7 +9,7 @@ BTreeData::BTreeData (uchar *node) clave = new ClaveFija (node); node += clave->Size (); - memcpy (&hijo_izquierdo, node, sizeof (uint)); + memcpy (&hijo, node, sizeof (uint)); } BTreeData::~BTreeData () @@ -28,10 +28,16 @@ uchar* BTreeData::ToArray () { uchar *out = new uchar[Size()]; memcpy (out, clave->ToArray (), clave->Size ()); - memcpy (out+clave->Size (), &hijo_izquierdo, sizeof (uint)); + memcpy (out+clave->Size (), &hijo, sizeof (uint)); return out; } +bool BTreeData::operator < (const BTreeData &data) const +{ + return (*clave) < (*(data.clave)); +} + + BTreeLeafData::~BTreeLeafData () { } @@ -45,3 +51,4 @@ uchar* BTreeLeafData::ToArray () { return clave->ToArray (); } +