From 58f5f2e6ba6f33bc457e98ec883f2834c9a5fe6f Mon Sep 17 00:00:00 2001 From: Ricardo Markiewicz Date: Sun, 30 Oct 2005 05:13:23 +0000 Subject: [PATCH] Agrego valores por default. --- src/btree_data.cpp | 6 ++++++ src/btree_data.h | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) 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; -- 2.43.0