8 #include "clave_fija.h"
10 /** Dato a guardar en los nodos */
14 BTreeData (uchar *node);
15 BTreeData (Clave *k, uint child);
16 virtual ~BTreeData ();
18 virtual uint Size () const;
19 virtual uchar *ToArray () const;
21 Clave* getClave () { return clave; }
22 uint getChild () { return hijo; }
23 void setChild (uint c) { hijo = c; }
25 bool operator < (const BTreeData &data) const;
26 bool operator == (const BTreeData &data) const;
27 virtual operator std::string () const {
28 std::string out = (*clave);
31 ss << ")" << "[" << hijo << "]";
40 /** Dato a guardar en las hojas */
41 class BTreeLeafData:public BTreeData {
43 BTreeLeafData (Clave *k) { clave = k; }
44 BTreeLeafData (uchar *node) { clave = new ClaveFija (node); }
45 virtual ~BTreeLeafData ();
47 virtual uint Size () const;
48 virtual uchar *ToArray () const;
49 virtual operator std::string () const {
57 class BTreeChildData:public BTreeData {
59 BTreeChildData (uint child):BTreeData () { hijo = child; clave = NULL; }
60 BTreeChildData (uchar *node);
61 virtual ~BTreeChildData ();
63 virtual uint Size () const;
64 virtual uchar *ToArray () const;
65 virtual operator std::string () const {
68 ss << "|" << hijo << "|";