X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/4582a22e254c682b0e91750725401d018c9e93f2..a164e095defb0f86d8dcde22c6054b5e2bc7da7b:/src/btree_data.h diff --git a/src/btree_data.h b/src/btree_data.h index cfe6ef8..f7106df 100644 --- a/src/btree_data.h +++ b/src/btree_data.h @@ -19,13 +19,15 @@ class BTreeData { virtual uchar *ToArray () const; Clave* getClave () { return clave; } + uint getChild () { return hijo; } + void setChild (uint c) { hijo = c; } bool operator < (const BTreeData &data) const; virtual operator std::string () const { std::string out = (*clave); std::stringstream ss; - ss << out << " "; - ss << hijo; + ss << "(" << out ; + ss << ")" << "[" << hijo << "]"; ss >> out; return out; } @@ -53,7 +55,7 @@ class BTreeLeafData:public BTreeData { class BTreeChildData:public BTreeData { public: - BTreeChildData (uint child):BTreeData () { hijo = child; } + BTreeChildData (uint child):BTreeData () { hijo = child; clave = NULL; } BTreeChildData (uchar *node); virtual ~BTreeChildData (); @@ -62,7 +64,7 @@ class BTreeChildData:public BTreeData { virtual operator std::string () const { std::string out; std::stringstream ss; - ss << hijo; + ss << "|" << hijo << "|"; ss >> out; return out; }