#include <ConcCommon.h>
CShortOccurCache is a structure which holds all found occurrences indexed by an index item No, if the number of occurrences for this index item is not greater than OccurBufferSize. This structure can take an advantage only if there are many corpus periods, otherwise it can even slow the program. But if there are many corpus periods, then having initialized this cache for the first period, the program can read from now on occurrences directly from the memory. CShortOccurCache is used only for one query at a time, so it is cleared in the very beginning of CConcHolder::GetAllHits.
void CShortOccurCache::Clear | ( | ) |
References m_IndexItemNo2Occurrences, and m_OccurrencesBody.
size_t CShortOccurCache::AddNewIndexItemNoToCache | ( | const CTokenNo * | pStart, | |
const CTokenNo * | pEnd | |||
) |
References m_IndexItemNo2Occurrences, and m_OccurrencesBody.
Referenced by CIndexSetForQueryingStage::AddOccurs().
const CTokenNo * CShortOccurCache::GetOccurrencesFromCache | ( | const int | CacheId, | |
DWORD & | Length | |||
) | const |
References m_IndexItemNo2Occurrences, m_OccurrencesBody, CShortOccurCache::CDataReference::m_VectorLength, and CShortOccurCache::CDataReference::m_VectorStartOffset.
Referenced by CIndexSetForQueryingStage::AddOccurs().
bool CShortOccurCache::CouldContainMore | ( | ) | const |
References m_OccurrencesBody, and MaxShortOccurCacheSize.
Referenced by CIndexSetForQueryingStage::AddOccurs().
vector<CDataReference> CShortOccurCache::m_IndexItemNo2Occurrences [private] |
this map contains a relation from index item No to the address of its occurrences
Referenced by AddNewIndexItemNoToCache(), Clear(), and GetOccurrencesFromCache().
vector<CTokenNo> CShortOccurCache::m_OccurrencesBody [private] |
this vector contains all occurrences for this cache
Referenced by AddNewIndexItemNoToCache(), Clear(), CouldContainMore(), and GetOccurrencesFromCache().