////////////////////////////////////////////////////////////////////////// DeleteChildArray //////////////////////////////////////////////////////////////////////////
| 693 | // DeleteChildArray |
| 694 | /////////////////////////////////////////////////////////////////////////////// |
| 695 | void cHierDatabaseIter::DeleteChildArray() //throw (eArchive, eHierDatabase) |
| 696 | { |
| 697 | ASSERT(!Done()); |
| 698 | ASSERT(CanDescend()); |
| 699 | cDebug d("cHierDatabaseIter::DeleteChildArray"); |
| 700 | |
| 701 | if (Done()) |
| 702 | { |
| 703 | d.TraceDetail("Attempt to DeleteChildArray() when Done() == true; returning\n"); |
| 704 | return; |
| 705 | } |
| 706 | if (!CanDescend()) |
| 707 | { |
| 708 | d.TraceDetail("Attempt to DeleteChildArray() when none exists; returning\n"); |
| 709 | return; |
| 710 | } |
| 711 | // |
| 712 | // make sure that the child index is empty... |
| 713 | // |
| 714 | if (!ChildArrayEmpty()) |
| 715 | { |
| 716 | ASSERT(false); |
| 717 | throw eHierDatabase(_T("Attempt to delete a child array that still has entries")); |
| 718 | } |
| 719 | // |
| 720 | // ok, no we can remove it... |
| 721 | // |
| 722 | mpDb->RemoveItem(cBlockRecordFile::tAddr(mIter->mChild.mBlockNum, mIter->mChild.mIndex)); |
| 723 | mIter->mChild = cHierAddr(); |
| 724 | util_RewriteObject(mpDb, &(*mIter), GetCurrentAddr()); |
| 725 | } |
| 726 | |
| 727 | |
| 728 | /////////////////////////////////////////////////////////////////////////////// |
no test coverage detected