keys.push_back (data);
}
+ DeAbrevKey (keys);
return keys;
}
+void BTree::AbrevKey (std::list<BTreeData *> &lst)
+{
+ /* Claves Fijas No se abrevian */
+ if (key_type == KEY_FIXED) return;
+
+ BTreeData *primera = NULL;
+ std::list<BTreeData *>::iterator it = lst.begin ();
+
+ while (it != lst.end ()) {
+ if ((*it)->Abrev (primera) == false)
+ primera = (*it);
+ it++;
+ }
+}
+
+void BTree::DeAbrevKey (std::list<BTreeData *> &lst)
+{
+ /* Claves Fijas No se abrevian */
+ if (key_type == KEY_FIXED) return;
+
+ BTreeData *primera = NULL;
+ std::list<BTreeData *>::iterator it = lst.begin ();
+
+ while (it != lst.end ()) {
+ if ((*it)->DesAbrev (primera) == false)
+ primera = (*it);
+ it++;
+ }
+}
+
void BTree::WriteKeys (uchar *node, BTreeNodeHeader &node_header, std::list<BTreeData *> &keys)
{
+ AbrevKey (keys);
+
std::list<BTreeData *>::iterator it = keys.begin ();
node += sizeof (BTreeNodeHeader);
it++;
}
- /* TODO : incrementar node_header.item_count aca o fuera de este metodo? */
+ DeAbrevKey (keys);
}
void BTree::PrintNode (uint num)