int bajas = atoi (argv[3]);
KeyManager<std::string> km;
- BTree tree ("test.idx", bloque, BTree::TYPE_UNIQUE, 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;
it = lst.begin ();
while (it != lst.end ()) {
- ClaveVariable c(*it);
+ ClaveVariable c(*it, 0);
double l = Random::Double (0.0f, 1.0f);
std::cout << l << " >= " << paltas << std::endl;
|| 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 ());
+ ClaveVariable c(km.GetRandom (), 0);
- 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;
+ }
}
}
int bien = 0;
int mal = 0;
while (it != l.end ()) {
- ClaveVariable c(*it);
+ ClaveVariable c(*it, 0);
BTreeFindResult *r;
r = tree.FindKey (c);