From a86378ad0949572fd260f105f3e02f2c3e1370a0 Mon Sep 17 00:00:00 2001 From: Ricardo Markiewicz Date: Wed, 14 Sep 2005 04:33:53 +0000 Subject: [PATCH] Agrego operadores a BTreeData --- src/btree_data.cpp | 7 +++++++ src/btree_data.h | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/btree_data.cpp b/src/btree_data.cpp index 27825d7..dd6f709 100644 --- a/src/btree_data.cpp +++ b/src/btree_data.cpp @@ -32,6 +32,12 @@ uchar* BTreeData::ToArray () 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 (); } + diff --git a/src/btree_data.h b/src/btree_data.h index b590040..c1d4261 100644 --- a/src/btree_data.h +++ b/src/btree_data.h @@ -10,12 +10,21 @@ /** Dato a guardar en los nodos */ class BTreeData { public: - BTreeData () {} + BTreeData () { clave = NULL; } BTreeData (uchar *node); virtual ~BTreeData (); virtual uint Size (); virtual uchar *ToArray (); + + + bool operator < (const BTreeData &data) const; + virtual operator std::string () const { + if (clave) { + return (*clave); + } + return "NoKey"; + } protected: Clave *clave; uint hijo; -- 2.43.0