From: Ricardo Markiewicz Date: Sun, 30 Oct 2005 05:13:23 +0000 (+0000) Subject: Agrego valores por default. X-Git-Tag: 1_0-pre2~29 X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/commitdiff_plain/58f5f2e6ba6f33bc457e98ec883f2834c9a5fe6f Agrego valores por default. --- diff --git a/src/btree_data.cpp b/src/btree_data.cpp index 70195fd..1adeb83 100644 --- a/src/btree_data.cpp +++ b/src/btree_data.cpp @@ -83,6 +83,7 @@ bool BTreeData::DesAbrev (BTreeData *anterior) BTreeLeafData::BTreeLeafData (uchar *node, int key_type) { + hijo = 0; if (key_type == BTree::KEY_FIXED) clave = new ClaveFija (node); else @@ -114,6 +115,7 @@ uchar* BTreeLeafData::ToArray () const BTreeChildData::BTreeChildData (uchar *node) { memcpy (&hijo, node, sizeof (uint)); + clave = NULL; } BTreeChildData::~BTreeChildData () @@ -132,3 +134,7 @@ uchar* BTreeChildData::ToArray () const return out; } +bool BTreeChildData::operator < (const BTreeData &data) const +{ + return false; +} diff --git a/src/btree_data.h b/src/btree_data.h index 53af1fc..b7f457a 100644 --- a/src/btree_data.h +++ b/src/btree_data.h @@ -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;