void PersistentArrayUlong::StoreElement(Ulong p_Index, Ulong p_Element) { ArrayIndex SegmentNumber; ArrayIndex ElementNumber; ModifiableElement TempVector; AccessVector TempUlongVector; ArrayIndex OldSegmentCount; ArrayIndex RequiredSegmentCount; SegmentNumber = ArrayIndex(p_Index / UlongEntriesPerBlock); ElementNumber = ArrayIndex(p_Index % UlongEntriesPerBlock); qfassert(SegmentNumber < m_MOA->GetMainObjectMaxElementCount(m_ObjectNumber)); OldSegmentCount = m_MOA->GetMainObjectElementCount(m_ObjectNumber); RequiredSegmentCount = SegmentNumber+1; if (RequiredSegmentCount > OldSegmentCount) m_MOA->GrowMainObject(m_ObjectNumber,RequiredSegmentCount); TempVector = m_MOA->GetModifiableElement(m_ObjectNumber,SegmentNumber); if (TempVector.GetSize() == 0) { TempVector = ModifiableElement(UlongEntriesPerBlock*sizeof(Ulong)); memset(TempVector.GetDataAddress(),0,TempVector.GetSize()); } TempUlongVector = AccessVector(UlongEntriesPerBlock, (Ulong *)TempVector.GetDataAddress()); TempUlongVector[ElementNumber] = p_Element; m_MOA->PutElement(m_ObjectNumber,SegmentNumber,TempVector); }