AND this idset with the operand idset. Place the result in this idset.
| Return Type | Function name | Arguments |
|---|---|---|
| hzIntset& | hzIntset::operator&= | (hzIntset&,) |
Declared in file: hzIntset.h
Defined in file : hzIntset.cpp
Function Logic:
Function body:
hzIntset& hzIntset::operator&= (hzIntset& op)
{
// AND this idset with the operand idset. Place the result in this idset.
//
// Argument: The operand idset
//
// Returns: Reference to this idset in all cases.
_hzfunc("hzIntset::operator&=") ;
hzVect<_idsNode*>* pNodesA ; // Vector of nodes (this)
hzVect<_idsNode*>* pNodesB ; // Vector of nodes (operand)
_idsNode* pNodeA ; // Node (this)
_idsNode* pNodeB ; // Node (operand)
_idset_seg segA ; // Value segment (this)
_idset_seg segB ; // Value segment (operand)
xbufIter ziA ; // EUI data iterator (this)
xbufIter ziB ; // EUI data iterator (operand)
uint32_t numNodes ; // Number of nodes
uint32_t nA ; // Iterator
uint32_t nB ; // Iterator
uint32_t nSofar ; // Value so far as a result of iteration
uint32_t nFound ; // Number of ids in EUI
// Is there anything to AND with?
if (!op.Count())
{ Clear() ; return *this ; }
// If this map is empty an AND operation cannot populate it - just return
if (!Count())
return *this ;
if (op.mx->m_bVect)
{
pNodesB = (hzVect<_idsNode*>*) op.mx->m_pData ;
numNodes = pNodesB->Count() ;
}
else
{
pNodesB = 0;
numNodes = 1;
}
// Go through operand idset nodes
for (nB = 0; nB < numNodes ; nB++)
{
pNodeB = op.mx->m_bVect ? pNodesB->operator[](nB) : (_idsNode*) op.mx->m_pData ;
ziB = pNodeB->m_Data ;
for (; !ziB.eof() ;)
{
nFound = _readEUI(segB, nSofar, ziB) ;
}
}
return *this ;
}