event_counter m_nLeftRightRotation; ///< Count of double left-over-right rotation
event_counter m_nRightLeftRotation; ///< Count of double right-over-left rotation
+ event_counter m_nInsertRebalanceReq; ///< Count of rebalance required after inserting
+ event_counter m_nRemoveRebalanceReq; ///< Count of rebalance required after removing
+
//@cond
void onFindSuccess() { ++m_nFindSuccess ; }
void onFindFailed() { ++m_nFindFailed ; }
void onRotateLeft() { ++m_nLeftRotation; }
void onRotateRightOverLeft() { ++m_nRightLeftRotation; }
void onRotateLeftOverRight() { ++m_nLeftRightRotation; }
+
+ void onInsertRebalanceRequired() { ++m_nInsertRebalanceReq; }
+ void onRemoveRebalanceRequired() { ++m_nRemoveRebalanceReq; }
//@endcond
};
void onRotateLeft() const {}
void onRotateRightOverLeft() const {}
void onRotateLeftOverRight() const {}
+
+ void onInsertRebalanceRequired() const {}
+ void onRemoveRebalanceRequired() const {}
//@endcond
};
++m_ItemCounter;
m_stat.onInsertSuccess();
- fix_height_and_rebalance( pDamaged, disp );
+ if ( pDamaged ) {
+ fix_height_and_rebalance( pDamaged, disp );
+ m_stat.onInsertRebalanceRequired();
+ }
return update_flags::result_inserted;
}
else
m_stat.onExtractValue();
- fix_height_and_rebalance( pDamaged, disp );
+ if ( pDamaged ) {
+ fix_height_and_rebalance( pDamaged, disp );
+ m_stat.onRemoveRebalanceRequired();
+ }
return update_flags::result_removed;
}
else {
<< "\t\t m_nRightRotation: " << s.m_nRightRotation.get() << "\n"
<< "\t\t m_nLeftRotation: " << s.m_nLeftRotation.get() << "\n"
<< "\t\t m_nLeftRightRotation: " << s.m_nLeftRightRotation.get() << "\n"
- << "\t\t m_nRightLeftRotation: " << s.m_nRightLeftRotation.get() << "\n";
+ << "\t\t m_nRightLeftRotation: " << s.m_nRightLeftRotation.get() << "\n"
+ << "\t\t m_nInsertRebalanceReq: " << s.m_nInsertRebalanceReq.get() << "\n"
+ << "\t\t m_nRemoveRebalanceReq: " << s.m_nRemoveRebalanceReq.get() << "\n"
+ ;
}
} //namespace std