20#include <osl/diagnose.h>
43 sal_Int32 nRes =
p->Compare( pFind );
46 else p = ( nRes < 0 ) ?
p->m_pLeft :
p->m_pRight;
62 OSL_ENSURE( pPivot && pParent && pPrev,
"The pointers may not be NULL!" );
63 *pParent = *pPrev =
nullptr;
69 while( pCur !=
nullptr )
97 OSL_ENSURE( pHeavy && pNew,
"The pointers is not allowed to be NULL!" );
98 if( pCur == pNew || !pNew )
101 sal_Int32 nRes =
Compare( pNew );
113 while( pCur != pNew )
137 assert(
m_pLeft &&
"The pointer is not allowed to be NULL!");
180 assert(
m_pRight &&
"The pointer is not allowed to be NULL!" );
221 if(
p && *
p && pDel )
224 sal_Int32 nRes = bPtrs ? sal_Int32( pCur == pDel ) : pCur->
Compare( pDel );
247 if( l ==
last->m_pRight )
287 StgAvlNode* pPivot, *pHeavy, *pParent, *pPrev;
292 if( *pRoot ==
nullptr )
298 sal_Int32 nRes = (*pRoot)->
Locate( pIns, &pPivot, &pParent, &pPrev );
302 assert(pPivot && pPrev &&
"The pointers may not be NULL!");
310 short nDelta = pPivot->
Adjust( &pHeavy, pIns );
318 pNewRoot = pPivot->
RotLL();
320 pNewRoot = pPivot->
RotLR();
323 pNewRoot = pPivot->
RotRR();
325 pNewRoot = pPivot->
RotRL();
327 if( pParent ==
nullptr )
329 else if( pPivot == pParent->
m_pLeft )
331 else if( pPivot == pParent->
m_pRight )
346 if( *pRoot ==
nullptr )
349 pDel =
Rem( pRoot, pDel,
false );
395 else p = (
n <
p->m_nId ) ?
p->m_pLeft :
p->m_pRight;
StgAvlIterator(StgAvlNode *)
short Adjust(StgAvlNode **, StgAvlNode const *)
virtual sal_Int32 Compare(const StgAvlNode *) const =0
static StgAvlNode * Rem(StgAvlNode **, StgAvlNode *, bool)
static bool Remove(StgAvlNode **, StgAvlNode *, bool bDel)
StgAvlNode * Find(StgAvlNode const *)
sal_Int32 Locate(StgAvlNode const *, StgAvlNode **, StgAvlNode **, StgAvlNode **)
static bool Insert(StgAvlNode **, StgAvlNode *)
constexpr OUStringLiteral last