Logo Search packages:      
Sourcecode: maxdb-7.5.00 version File versions

template<class T>
void Data_SplitSpace< T >::Deassign ( bool  isOK = true  )  [inline]

All parts are released, if ok, then release and update pages.

Parameters:
isOK [in] default is true

Definition at line 209 of file Data_SplitSpace.hpp.

Referenced by Data_ChainSplitSpaceBackwardRead< PAGE >::Iterator::Assign(), Data_ChainSplitSpaceForwardRead< PAGE >::Iterator::Assign(), Data_ChainSplitSpaceBackwardRead< PAGE >::Iterator::Invalidate(), Data_ChainSplitSpaceForwardRead< PAGE >::Iterator::Invalidate(), Data_ChainSplitSpaceForwardRead< PAGE >::Iterator::operator++(), Data_ChainSplitSpaceBackwardRead< PAGE >::Iterator::operator--(), and Data_SplitSpace< PAGE >::~Data_SplitSpace().

    {
        if ( ! IsAssigned() )
            return;
        
        // PTS 1133123 UH 2004-12-22 completely rewritten

        // cleanup made changes to: NextPageNO, FirstFreeOffset and remove pages which were appended
        
        for ( PartNo part = m_CurrentPart; part >= 0; --part )
        {
            if ( ! isOK
                 &&
                 m_Parts[part].Page.AccessMode() != Data_ForRead )
            {            
                if ( m_NumPagesAppended > 0 )
                {
                    // first remove appended new pages
                    --m_NumPagesAppended;
                    if ( part > 0 )
                        m_Parts[part].Page.Remove(m_Parts[part-1].Page);
                    else
                        if ( part == 0 )
                        {
                            if ( m_PrevPage.IsAssigned() )
                                m_Parts[part].Page.Remove(m_PrevPage);
                            else
                                RTE_Crash(Data_Exception(__CONTEXT__,SAPDBERR_ASSERT_STATE_FAILED, "too many pages to remove"));
                        }
                        else
                            RTE_Crash(Data_Exception(__CONTEXT__,SAPDBERR_ASSERT_STATE_FAILED, "too many pages to remove"));
                }
                else
                    if ( part == 0 )
                    {
                        m_Parts[0].Page.SetNextPageNo(Data_PageNo());
                        m_Parts[0].Page.UndoLastReservedSpace(m_Parts[0].Length);
                    }
                    else
                        RTE_Crash(Data_Exception(__CONTEXT__,SAPDBERR_ASSERT_STATE_FAILED, "too few pages to remove"));
            }
            m_Parts[part].Page.Deassign(isOK);
        }

        if ( m_PrevPage.IsAssigned() )
            m_PrevPage.Deassign(isOK);
        
        m_CurrentPart.Invalidate();
        m_NumPagesAppended = 0;
    }


Generated by  Doxygen 1.6.0   Back to index