int bajas = atoi (argv[3]);
KeyManager<std::string> km;
- BTree tree ("test.idx", bloque, BTree::KEY_VARIABLE);
+ BTree tree ("test.idx", bloque, BTree::TYPE_IDENTIFICACION, BTree::KEY_VARIABLE);
std::list<std::string> lst;
std::list<std::string>::iterator it;
|| l >= paltas) {
std::string sss = c;
std::cout << "Clave Agregada " << sss << std::endl;
- tree.AddKey (c);
- km.AddValue (*it);
+ try {
+ tree.AddKey (c);
+ km.AddValue (*it);
+ } catch (Exception *e) {
+ std::cout << e->Message () << std::endl;
+ }
it++;
} else {
/* Tengo que borrar una clave entre 0 e "i" de la lista
* porque son las que ya agregue. */
ClaveVariable c(km.GetRandom ());
- tree.DelKey (c);
- std::string sss = c;
- std::cout << "Clave Borrada " << sss << std::endl;
+ try {
+ tree.DelKey (c);
+ std::string sss = c;
+ std::cout << "Clave Borrada " << sss << std::endl;
+ } catch (Exception *e) {
+ std::cout << e->Message () << std::endl;
+ }
}
}
std::cout << " Miss : " << mal << "\n";
std::cout << " Total : " << (bien+mal) << "\n";
- return 0;
+ return mal;
}