IteratorTripleID *TriplesKyoto::search(TripleID &pattern) { #if 1 cout << endl << "DB size: " << db.count() << endl; DB::Cursor *cur = db.cursor(); cur->jump(); size_t count = 0; size_t total = db.count(); while(count<total-1) { size_t fsize; TripleID *ptr = (TripleID*)cur->get_key(&fsize, true); cout << "Triple: " << *ptr << endl; count++; } cout << "Iterated" << endl; delete cur; db.close(); cout << "Closed" << endl; exit(0); #endif string patternString = pattern.getPatternString(); if(patternString=="???") { return new TriplesKyotoIterator(&db); } else { return new SequentialSearchIteratorTripleID(pattern, new TriplesKyotoIterator(&db)); } }
unsigned char *next() { cur->get_key(&key, true); count++; return (unsigned char*)(key.c_str()); }