HitDoc* Hits::getHitDoc(const size_t n){ if (n >= _length){ TCHAR buf[100]; _sntprintf(buf, 100,_T("Not a valid hit number: %d"),n); _CLTHROWT(CL_ERR_IndexOutOfBounds, buf ); } if (n >= hitDocs.size()) getMoreDocs(n); return hitDocs[n]; }
Hits::Hits(Searcher* s, Query* q, Filter* f, const Sort* _sort): query(q), searcher(s), filter(f), sort(_sort) , _length(0), first(NULL), last(NULL), numDocs(0), maxDocs(200), nDeletedHits(0), debugCheckedForDeletions(false) { //Func - Constructor //Pre - s contains a valid reference to a searcher s // q contains a valid reference to a Query // f is NULL or contains a pointer to a filter //Post - The instance has been created hitDocs = _CLNEW CL_NS(util)::CLVector<HitDoc*, CL_NS(util)::Deletor::Object<HitDoc> >; nDeletions = countDeletions(s); //retrieve 100 initially getMoreDocs(50); _lengthAtStart = _length; }
Hits::Hits(Searcher* s, Query* q, Filter* f, const Sort* _sort): query(q), searcher(s), filter(f), sort(_sort) { //Func - Constructor //Pre - s contains a valid reference to a searcher s // q contains a valid reference to a Query // f is NULL or contains a pointer to a filter //Post - The instance has been created _length = 0; first = NULL; last = NULL; numDocs = 0; maxDocs = 200; //retrieve 100 initially getMoreDocs(50); }