Purpose: Fetch ids from the idset into an id buffer Note that the presumed scenario is that the idset will be a search result, which will not have a vector of nodes. The function is written however, to cope with a vector.
| Return Type | Function name | Arguments |
|---|---|---|
| uint32_t | hzIntset::Fetch | (hzVect<uint32_t>&,uint32_t,uint32_t,) |
Declared in file: hzIntset.h
Defined in file : hzIntset.cpp
Function Logic:
Function body:
uint32_t hzIntset::Fetch (hzVect<uint32_t>& Result)uint32_t nStart, uint32_t nReq,
{
// Purpose: Fetch ids from the idset into an id buffer
//
// Note that the presumed scenario is that the idset will be a search result, which will not have a vector of nodes. The function is written however, to cope with a vector.
//
// Arguments: 1) Result The id buffer (type uint32_t)
// 2) nStart The start position (ignore all ids before this)
// 3) nReq The number to fetch
//
// Returns: Number of ids fetched
_hzfunc("hzIntset::Fetch") ;
hzVect<_idsNode*>* pNodes ; // Vector of nodes
_idsNode* pNode ; // Segment (to process)
_idset_seg seg ; // Value segment
xbufIter zi ; // Iterator into low pop idset nodes
uint32_t numNodes ; // Number of nodes
uint32_t nSofar ; // Value so far as a result of iteration
uint32_t nFound ; // Number of ids in EUI
uint32_t n ; // Iterator
// uint32_t nPosn = 0 ; // Position (in the bitmap so far) attained last segment
// uint32_t nMax = 0 ; // Maximum id this segment
// uint32_t segNo ; // Segment number
// uint32_t segAddr ; // Segment address
// uint32_t nSegStart ; // Starting position within a segment
// uint32_t x ; // For iterating resut of segment fetch
// uint32_t v ; // For value
Result.Clear() ;
if (!mx)
return 0;
if (!mx->m_pData)
return 0;
if (nStart >&eq; mx->m_nPop)
return 0;
if (mx->m_bVect)
{
pNodes = (hzVect<_idsNode*>*) mx->m_pData ;
numNodes = pNodes->Count() ;
}
else
{
pNodes = 0;
numNodes = 1;
}
for (n = 0; n < numNodes ; n++)
{
pNode = mx->m_bVect ? pNodes->operator[](n) : (_idsNode*) mx->m_pData ;
zi = pNode->m_Data ;
// While not yet at start
for (;;)
{
nFound = _readEUI(seg, nSofar, zi) ;
}
}
return Result.Count() ;
}