if (bFirst)
{
m_aRoot = m_xIndex->getRoot();
m_aCurLeaf.Clear();
}
if (!m_pOperator)
{ // Preparation, position on the smallest element if (bFirst)
{
ONDXPage* pPage = m_aRoot; while (pPage && !pPage->IsLeaf())
pPage = pPage->GetChild(m_xIndex.get());
ONDXKey* OIndexIterator::GetFirstKey(ONDXPage* pPage, const OOperand& rKey)
{ // searches a given key // Speciality: At the end of the algorithm // the actual page and the position of the node which fulfil the // '<='-condition are saved. this is considered for inserts. // ONDXIndex* m_pIndex = GetNDXIndex();
OOp_COMPARE aTempOp(SQLFilterOperator::GREATER);
sal_uInt16 i = 0;
if (pPage->IsLeaf())
{ // in the leaf the actual operation is run, otherwise temp. (>) while (i < pPage->Count() && !m_pOperator->operate(&((*pPage)[i]).GetKey(), &rKey))
i++;
} else while (i < pPage->Count() && !aTempOp.operate(&((*pPage)[i]).GetKey(), &rKey))
i++;
if (bFirst)
{ // Preparation, position on the smallest element
ONDXPage* pPage = m_aRoot; switch (ePredicateType)
{ case SQLFilterOperator::NOT_EQUAL: case SQLFilterOperator::LESS: case SQLFilterOperator::LESS_EQUAL: while (pPage && !pPage->IsLeaf())
pPage = pPage->GetChild(m_xIndex.get());
m_aCurLeaf = pPage;
m_nCurNode = NODE_NOTFOUND;
}
switch (ePredicateType)
{ case SQLFilterOperator::NOT_EQUAL: while ((pKey = GetNextKey()) != nullptr) if (m_pOperator->operate(pKey, m_pOperand)) break; break; case SQLFilterOperator::LESS: while ((pKey = GetNextKey()) != nullptr) if (!pKey->getValue().isNull()) break; break; case SQLFilterOperator::LESS_EQUAL: while ((pKey = GetNextKey()) != nullptr)
; break; case SQLFilterOperator::GREATER_EQUAL: case SQLFilterOperator::EQUAL:
pKey = GetFirstKey(m_aRoot, *m_pOperand); break; case SQLFilterOperator::GREATER:
pKey = GetFirstKey(m_aRoot, *m_pOperand); if (!pKey) while ((pKey = GetNextKey()) != nullptr) if (m_pOperator->operate(pKey, m_pOperand)) break;
}
} else
{ switch (ePredicateType)
{ case SQLFilterOperator::NOT_EQUAL: while ((pKey = GetNextKey()) != nullptr) if (m_pOperator->operate(pKey, m_pOperand)) break; break; case SQLFilterOperator::LESS: case SQLFilterOperator::LESS_EQUAL: case SQLFilterOperator::EQUAL:
pKey = GetNextKey(); if (pKey == nullptr || !m_pOperator->operate(pKey, m_pOperand))
{
pKey = nullptr;
m_aCurLeaf.Clear();
} break; case SQLFilterOperator::GREATER_EQUAL: case SQLFilterOperator::GREATER:
pKey = GetNextKey();
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.