// VirtualTable.cpp : _xZkqqHx_iDeDiDjDiDhGiDiKiDiBiDjDiDgFiBfLiDfGiDiHiDjD_xHqqkZx_ _xZkqqHx_iDhEiDeAiDeDiDiL_xHqqkZx_
//

#include "stdafx.h"
#include "UtilErr.h"			// For FFThrowMiscUnknown.
#include "VirtualTable.h"		// This header.

/////////////////////////////////////////////////////////////////////////////
// FCVirtualTable
//
// FCVirtualTable_xZkqqHx_iCmNiBeBiJlMjBhKiDgFiBfLiDhFiDiLiCmM_xHqqkZx_READ_xZkqqHx_iDeMiDiDiDgCiDfGiDiFiCmG_xHqqkZx_WRITE_xZkqqHx_iDeMiDiDiDgCiDfGiDiFiCpA_xHqqkZx_
// _xZkqqHx_iDfGiBfLiDiAiDiMiDfIiCmJiKmHjHjNiClHiCoJiBeC_xHqqkZx_
// _xZkqqHx_jBkGiClPiBeBiDgFiBfLiDhFiDiLiCmMjDmHiCnNiPgPiClFiCkKiCkAiCoJiPoKiNiHiBeB_xHqqkZx_WRITE_xZkqqHx_iDeMiDiDiDgCiDfGiDiFiCpAiMjPiNpFiClFiBeBiDeMiDiDiDgCiDfGiDiF_xHqqkZx_
// _xZkqqHx_iClDiCoKiCmEiCkCiCoJiPoKiNiHiCmN_xHqqkZx_WRITE_xZkqqHx_iDeMiDiDiDgCiDfGiDiFiCmMjCgMiCpAjFnEiClFiBeBiDeMiDiDiDgCiDfGiDiFiClDiCoKiCmEiCkCiCmIiCkCiPoKiNiHiCmNiBeB_xHqqkZx_
// READ_xZkqqHx_iDeMiDiDiDgCiDfGiDiFiCpAiMjPiNpFiClHiCoJiBeC_xHqqkZx_
// _xZkqqHx_iCnMiClNiBeBiDhEiDiJiDgCiDfGiDiFiMoDiCmNiBeB_xHqqkZx_WRITE_xZkqqHx_iDeMiDiDiDgCiDfGiDiFiCmMiDiMiDfCiBfLiDgIiCpA_xHqqkZx_READ_xZkqqHx_iDeMiDiDiDgCiDfGiDiFiCnGiInKjDkOiClHiCoJiBeC_xHqqkZx_
//

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCVirtualTable::FCVirtualTable
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.02.13 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
FCVirtualTable::FCVirtualTable ()
			:	BASE_CLASS()
{
} // FCVirtualTable::FCVirtualTable.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCVirtualTable::~FCVirtualTable
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgGiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.02.13 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
FCVirtualTable::~FCVirtualTable ()
{
} // FCVirtualTable::~FCVirtualTable.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCVirtualTable::GetRecordCount
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iJlMjBhKiDgFiBfLiDhFiDiLiCmMiDiMiDfCiBfLiDgIjAjEiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iJlMjBhKiDgFiBfLiDhFiDiLiCmMiDiMiDfCiBfLiDgIjAjEiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.02.13 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
DWORD FCVirtualTable::GetRecordCount () const
{
	// WRITE_xZkqqHx_iJlMjBhKiDgFiBfLiDhFiDiLiCmMiDiMiDfCiBfLiDgIiPeJjCfLiCpAjFnEiClHiBeC_xHqqkZx_
	// WRITE_xZkqqHx_iDeMiDiDiDgCiDfGiDiFiCkKjGlDiCkNiCmEiCoAiBeB_xHqqkZx_WRITE_xZkqqHx_iJlMjBhKiDgFiBfLiDhFiDiLiCmMjAoGjDkKiCmN_xHqqkZx_
	// _xZkqqHx_jFkIjHjNiDgFiBfLiDhFiDiLiCmMiPeJjCfLiCmJiPiJiKpKiJlLiClDiCoKiCmEiCkCiCoJiClNiCnPjBoFiPoEjFhGiBeC_xHqqkZx_
	return GetWriteRecordEnd();
} // FCVirtualTable::GetRecordCount.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCVirtualTable::GetRecordPrimaryId
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiDiMiDfCiBfLiDgIiCmMiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	dwIndex	:_xZkqqHx_iDiMiDfCiBfLiDgIiDeDiDjDiDgGiDgCiDeOiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDiMiDfCiBfLiDgIiCmMiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.02.13 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
flint FCVirtualTable::GetRecordPrimaryId (DWORD dwIndex) const
{
	return GetTableRecord(dwIndex).m_fliPrimaryId;
} // FCVirtualTable::GetRecordPrimaryId.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCVirtualTable::GetRecordAppendIdentifier
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiDiMiDfCiBfLiDgIiCmMjCmHiJmB_xHqqkZx_Identifier_xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	dwIndex	:_xZkqqHx_iDiMiDfCiBfLiDgIiDeDiDjDiDgGiDgCiDeOiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDiMiDfCiBfLiDgIiCmMjCmHiJmB_xHqqkZx_Identifier_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.02.13 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
DWORD FCVirtualTable::GetRecordAppendIdentifier (DWORD dwIndex) const
{
	return GetTableRecord(dwIndex).m_dwAppendIdentifier;
} // FCVirtualTable::GetRecordAppendIdentifier.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCVirtualTable::GetRecordDataSize
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiDiMiDfCiBfLiDgIiCmMiDgGiBfLiDfOiDfEiDeDiDfJiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	dwIndex	:_xZkqqHx_iDiMiDfCiBfLiDgIiDeDiDjDiDgGiDgCiDeOiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDiMiDfCiBfLiDgIiCmMiDgGiBfLiDfOiDfEiDeDiDfJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.02.13 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
DWORD FCVirtualTable::GetRecordDataSize (DWORD dwIndex) const
{
	return GetTableRecord(dwIndex).m_dwSize;
} // FCVirtualTable::GetRecordDataSize.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCVirtualTable::GetRecordData
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiDiMiDfCiBfLiDgIiCmMiDgGiBfLiDfOiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDataBuff	:_xZkqqHx_iDgGiBfLiDfOiCpAiOpDiCkPiOoGiCoJiDgPiDgCiDhEiDeAiCpAiOhHjCoIiBeC_xHqqkZx_
 *			dwBuffSize	:_xZkqqHx_iDgPiDgCiDhEiDeAiDfEiDeDiDfJiCpAiOhHjCoIiBeCjBfDiCmEiCmMiDgGiBfLiDfOiCpA_xHqqkZx_
 *						 _xZkqqHx_iOoGjDlOiClHiCoJiPoKiNiHiCmN_xHqqkZx_ DOWRD(-1) _xZkqqHx_iCpAiOhHjCoIiClFiCmEiCoAjHmHiCkCiBeC_xHqqkZx_
 *			dwIndex		:_xZkqqHx_iDiMiDfCiBfLiDgIiDeDiDjDiDgGiDgCiDeOiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
 *			dwStartOffset:_xZkqqHx_iDgGiBfLiDfOiCmMjDmHiCnNiPgPiClFiCpAiKeKiOgOiClHiCoJiImKjChFiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jDmHiCnNiPgPiClDiCoKiClNiDgGiBfLiDfOiDfEiDeDiDfJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iDgGiBfLiDfOiCmNiBeBjDmHiCnNiPgPiClHiImKjChFiCpAiOhHjCoIiCmFiCkLiCoJiBeCjHoBiCkGiCmOiCfBiCePiDgPiDeDiDgHiCmMiDgGiBfLiDfO_xHqqkZx_
 *			_xZkqqHx_iCpAjDmHiCnNiPgPiClHiPoKiNiHiCmJiBeB_xHqqkZx_dwStartOffset=_xZkqqHx_iCfAiCePiCpAiOhHjCoIiClHiCoJiCmGiBeB_xHqqkZx_
 *			_xZkqqHx_iCfAiCePiDgPiDeDiDgHjGnKiCkJiCoHiNmFiMoDiCnMiCmFiBeBiCmCiCnMiCoIiMoDjElMiCfAiCePiDgPiDeDiDgHiCkKjDmHiCnNiPgPiClDiCoKiCoJiBeC_xHqqkZx_
 *			_xZkqqHx_jAoGjDkKiCmM_xHqqkZx_CRC(WORD_xZkqqHx_iMfO_xHqqkZx_)_xZkqqHx_iCpAiDfIiDeMiDgCiDhGiClFiCmEjDmHiCnNiPgPiClJiCoJiCoGiCkEiBeBiClBiCmMiCoGiCkEiCmIiOgEjHgMiCmJ_xHqqkZx_
 *			_xZkqqHx_jFmPiNfIiClFiClNiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.12.19 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
DWORD FCVirtualTable::GetRecordData (	void* pDataBuff,
										DWORD dwBuffSize,
										DWORD dwIndex,
										DWORD dwStartOffset) const
{
	return m_heap.GetData(pDataBuff, dwBuffSize, dwStartOffset, GetTableRecord(dwIndex).m_dwDataId);
} // FCVirtualTable::GetRecordData.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCVirtualTable::GetRecordData
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiDiMiDfCiBfLiDgIiCmMiDgGiBfLiDfOiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	vDataBuff	:_xZkqqHx_iDgGiBfLiDfOiCpAiOpDiCkPiOoGiCoJiDgPiDgCiDhEiDeAiCpAiOhHjCoIiBeC_xHqqkZx_
 *			dwIndex		:_xZkqqHx_iDiMiDfCiBfLiDgIiDeDiDjDiDgGiDgCiDeOiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
 *			dwStartOffset:_xZkqqHx_iDgGiBfLiDfOiCmMjDmHiCnNiPgPiClFiCpAiKeKiOgOiClHiCoJiImKjChFiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iDgGiBfLiDfOiCmNiBeBjDmHiCnNiPgPiClHiImKjChFiCpAiOhHjCoIiCmFiCkLiCoJiBeCjHoBiCkGiCmOiCfBiCePiDgPiDeDiDgHiCmMiDgGiBfLiDfO_xHqqkZx_
 *			_xZkqqHx_iCpAjDmHiCnNiPgPiClHiPoKiNiHiCmJiBeB_xHqqkZx_dwStartOffset=_xZkqqHx_iCfAiCePiCpAiOhHjCoIiClHiCoJiCmGiBeB_xHqqkZx_
 *			_xZkqqHx_iCfAiCePiDgPiDeDiDgHjGnKiCkJiCoHiNmFiMoDiCnMiCmFiBeBiCmCiCnMiCoIiMoDjElMiCfAiCePiDgPiDeDiDgHiCkKjDmHiCnNiPgPiClDiCoKiCoJiBeC_xHqqkZx_
 *			_xZkqqHx_jAoGjDkKiCmM_xHqqkZx_CRC(WORD_xZkqqHx_iMfO_xHqqkZx_)_xZkqqHx_iCpAiDfIiDeMiDgCiDhGiClFiCmEjDmHiCnNiPgPiClJiCoJiCoGiCkEiBeBiClBiCmMiCoGiCkEiCmIiOgEjHgMiCmJ_xHqqkZx_
 *			_xZkqqHx_jFmPiNfIiClFiClNiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.02.13 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCVirtualTable::GetRecordData (BYTEVector& vDataBuff, DWORD dwIndex, DWORD dwStartOffset) const
{
	vDataBuff.resize(GetRecordDataSize(dwIndex) - dwStartOffset);
	GetRecordData(&vDataBuff.front(), vDataBuff.size(), dwIndex, dwStartOffset);
} // FCVirtualTable::GetRecordData.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCVirtualTable::GetRecordLastPrimaryId
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iJlMjBhKiDgFiBfLiDhFiDiLiCmMiNmFiMoDiCmMiDiMiDfCiBfLiDgIiCmMiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iNmFiMoDiCmMiDiMiDfCiBfLiDgIiCmMiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iBeCiDiMiDfCiBfLiDgIiCkKjGlDiCkCiPoKiNiHiCmN_xHqqkZx_ -1_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.02.13 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
flint FCVirtualTable::GetRecordLastPrimaryId () const
{
	if (GetRecordCount() == 0)
		return flint(-1);
	else
		return GetRecordPrimaryId(GetRecordCount() - 1);
} // FCVirtualTable::GetRecordLastPrimaryId.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCVirtualTable::IsNullRecord
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiDiMiDfCiBfLiDgIiCkKjGkCjAnNjCoIiCkJiCmHiCkEiCkJiCpAjClCiCnHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	dwIndex	:_xZkqqHx_iDiMiDfCiBfLiDgIiDeDiDjDiDgGiDgCiDeOiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jGkCjAnNjCoIiCmMiPoKiNiHiCmN_xHqqkZx_TRUE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiDiMiDfCiBfLiDgIiCmJ_xHqqkZx_WRITE_xZkqqHx_iDeMiDiDiDgCiDfGiDiFiDiMiDfCiBfLiDgIiCkKjHeMiCoJiPoKiNiHiCmNiBeB_xHqqkZx_
 *			_xZkqqHx_jGlDiPpAiMiPiCmJ_xHqqkZx_FALSE_xZkqqHx_iCmGiCmIiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.02.13 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCVirtualTable::IsNullRecord (DWORD dwIndex) const
{
	if (IsWriteRecordInside(dwIndex))
		return FALSE;
	return (GetTableRealRecord(dwIndex).m_dwDataId == DWORD(-1));
} // FCVirtualTable::IsNullRecord.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCVirtualTable::PrimaryIdToLowerBoundIndex
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCmGjDkPiClGiCkJjBoFiCkLiCkCiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCpAiOjNiCmC_xHqqkZx_
 *			_xZkqqHx_iNmFiPiJiCmMiDiMiDfCiBfLiDgIiCpAiMjPiNpFiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	fliPrimariId	:_xZkqqHx_iDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDiMiDfCiBfLiDgIiDeDiDjDiDgGiDgCiDeOiDfIiBeCiMkJiCmCiCkJiCoHiCmIiCkCiPoKiNiHiCmN_xHqqkZx_ DWORD(-1)_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	_xZkqqHx_iDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCkKiPlIiPiHiCmJiDfMiBfLiDgHiClDiCoKiCmEiCkCiCoJiPoKiNiHiCmMiCnNjHeMiMpIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iJlKjAhNiCmJjHoBiCpAiOkGiClHiBeC_xHqqkZx_
 *
 *			_xZkqqHx_iEkBiEjPiEkGiEjPiEkGiEjPiEkGiEjPiEkGiEjPiEkGiEjPiEkGiEjPiEkGiEjPiEkGiEjPiEkGiEjPiEkGiEjPiEkC_xHqqkZx_
 *			_xZkqqHx_iEkA_xHqqkZx_ 4_xZkqqHx_iEkA_xHqqkZx_ 4_xZkqqHx_iEkA_xHqqkZx_ 6_xZkqqHx_iEkA_xHqqkZx_ 6_xZkqqHx_iEkA_xHqqkZx_ 7_xZkqqHx_iEkA_xHqqkZx_ 7_xZkqqHx_iEkA_xHqqkZx_ 7_xZkqqHx_iEkA_xHqqkZx_ 8_xZkqqHx_iEkA_xHqqkZx_ 8_xZkqqHx_iEkA_xHqqkZx_ 9_xZkqqHx_iEkA_xHqqkZx_ 9_xZkqqHx_iEkA_xHqqkZx_
 *			_xZkqqHx_iEkFiEjPiEkJiEjPiEkJiEjPiEkJiEjPiEkJiEjPiEkJiEjPiEkJiEjPiEkJiEjPiEkJiEjPiEkJiEjPiEkJiEjPiEkH_xHqqkZx_
 *			   0   1   2   3   4   5   6   7   8   9  10
 *
 *			-------------------------------------------------------------
 *			5 _xZkqqHx_iCpAiMjPiNpFiClHiCoJiPoKiNiHiBeC_xHqqkZx_
 *			L_INDEX = 0  H_INDEX = 10
 *			(0 + 10) / 2 = 5
 *			5->7 5_xZkqqHx_iImIiPoDiCmIiCmMiCmF_xHqqkZx_ H_INDEX = 5
 *			(0 + 5) / 2 = 2
 *			2->6 5_xZkqqHx_iImIiPoDiCmIiCmMiCmF_xHqqkZx_ H_INDEX = 2
 *			(0 + 2) / 2 = 1
 *			1->4 5_xZkqqHx_jGkCjGjOiCmIiCmMiCmF_xHqqkZx_ L_INDEX = 1
 *			L_INDEX = 1, H_INDEX = 2_xZkqqHx_iBeC_xHqqkZx_1->4 5_xZkqqHx_jGkCjGjOiCmIiCmMiCmF_xHqqkZx_ ANS = 2
 *			-------------------------------------------------------------
 *			6 _xZkqqHx_iCpAiMjPiNpFiClHiCoJiPoKiNiHiBeC_xHqqkZx_
 *			L_INDEX = 0  H_INDEX = 10
 *			(0 + 10) / 2 = 5
 *			5->7 6_xZkqqHx_iImIiPoDiCmIiCmMiCmF_xHqqkZx_ H_INDEX = 5
 *			(0 + 5) / 2 = 2
 *			2->6 6_xZkqqHx_iImIiPoDiCmIiCmMiCmF_xHqqkZx_ H_INDEX = 2
 *			(0 + 2) / 2 = 1
 *			1->4 6_xZkqqHx_jGkCjGjOiCmIiCmMiCmF_xHqqkZx_ L_INDEX = 1
 *			L_INDEX = 1, H_INDEX = 2_xZkqqHx_iBeC_xHqqkZx_1->4 6_xZkqqHx_jGkCjGjOiCmIiCmMiCmF_xHqqkZx_ ANS = 2
 *			-------------------------------------------------------------
 *			7 _xZkqqHx_iCpAiMjPiNpFiClHiCoJiPoKiNiHiBeC_xHqqkZx_
 *			L_INDEX = 0  H_INDEX = 10
 *			(0 + 10) / 2 = 5
 *			5->7 7_xZkqqHx_iImIiPoDiCmIiCmMiCmF_xHqqkZx_ H_INDEX = 5
 *			(0 + 5) / 2 = 2
 *			2->6 7_xZkqqHx_jGkCjGjOiCmIiCmMiCmF_xHqqkZx_ L_INDEX = 2
 *			(2 + 5) / 2 = 3
 *			3->6 7_xZkqqHx_jGkCjGjOiCmIiCmMiCmF_xHqqkZx_ L_INDEX = 3
 *			(3 + 5) / 2 = 4
 *			4->7 7_xZkqqHx_iImIiPoDiCmIiCmMiCmF_xHqqkZx_ H_INDEX = 4
 *			L_INDEX = 3, H_INDEX = 4_xZkqqHx_iBeC_xHqqkZx_3->6 7_xZkqqHx_jGkCjGjOiCmIiCmMiCmF_xHqqkZx_ ANS = 4
 *			-------------------------------------------------------------
 *			2 _xZkqqHx_iCpAiMjPiNpFiClHiCoJiPoKiNiHiBeC_xHqqkZx_
 *			L_INDEX = 0  H_INDEX = 10
 *			(0 + 10) / 2 = 5
 *			5->7 2_xZkqqHx_iImIiPoDiCmIiCmMiCmF_xHqqkZx_ H_INDEX = 5
 *			(0 + 5) / 2 = 2
 *			2->6 2_xZkqqHx_iImIiPoDiCmIiCmMiCmF_xHqqkZx_ H_INDEX = 2
 *			(0 + 2) / 2 = 1
 *			1->4 2_xZkqqHx_iImIiPoDiCmIiCmMiCmF_xHqqkZx_ H_INDEX = 1
 *			L_INDEX = 0, H_INDEX = 1_xZkqqHx_iBeC_xHqqkZx_0->4 2_xZkqqHx_iImIiPoDiCmIiCmMiCmF_xHqqkZx_ ANS = 0
 *			-------------------------------------------------------------
 *			11 _xZkqqHx_iCpAiMjPiNpFiClHiCoJiPoKiNiHiBeC_xHqqkZx_
 *			L_INDEX = 0  H_INDEX = 10
 *			(0 + 10) / 2 = 5
 *			5->7 11_xZkqqHx_jGkCjGjOiCmIiCmMiCmF_xHqqkZx_ L_INDEX = 5
 *			(5 + 10) / 2 = 7
 *			7->8 11_xZkqqHx_jGkCjGjOiCmIiCmMiCmF_xHqqkZx_ L_INDEX = 7
 *			(7 + 10) / 2 = 8
 *			8->8 11_xZkqqHx_jGkCjGjOiCmIiCmMiCmF_xHqqkZx_ L_INDEX = 8
 *			(8 + 10) / 2 = 9
 *			9->9 11_xZkqqHx_jGkCjGjOiCmIiCmMiCmF_xHqqkZx_ L_INDEX = 9
 *			L_INDEX = 9, H_INDEX = 10_xZkqqHx_iBeC_xHqqkZx_9->9 11_xZkqqHx_jGkCjGjOiBeB_xHqqkZx_10->9 11_xZkqqHx_jGkCjGjOiCmIiCmMiCmF_xHqqkZx_ ANS = -1
 *			-------------------------------------------------------------
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
DWORD FCVirtualTable::PrimaryIdToLowerBoundIndex (flint fliPrimaryId) const
{
	// _xZkqqHx_iDiMiDfCiBfLiDgIjAjEiCkKiCePiCmMiPoKiNiHiCmNiDeHiDiJiBfLjCgM_xHqqkZx_ DWORD(-1)_xZkqqHx_iBeC_xHqqkZx_
	if (GetRecordCount() == 0)
		return DWORD(-1);
	// _xZkqqHx_iJlKiMmAjCgMiDeDiDjDiDgGiDgCiDeOiDfIiBeC_xHqqkZx_
	DWORD dwIndexLower = 0;
	// _xZkqqHx_iPoDiMmAjCgMiDeDiDjDiDgGiDgCiDeOiDfIiBeC_xHqqkZx_
	DWORD dwIndexUpper = GetRecordCount() - 1;
	// _xZkqqHx_iPoDiMmAjCgMiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
	const flint fliPrimaryIdUpper = GetRecordPrimaryId(dwIndexUpper);

	// _xZkqqHx_iOhHjCoIiCmMiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCkKiPoDiMmAjCgMiCmJjDpMiCoJiCkJjClCiCnHiCoJiBeC_xHqqkZx_
	// _xZkqqHx_jDpMiCoHiCmIiCkCiPoKiNiHiCmNiDeHiDiJiBfLjCgM_xHqqkZx_ DWORD(-1)_xZkqqHx_iBeC_xHqqkZx_
	if (fliPrimaryIdUpper < fliPrimaryId)
		return DWORD(-1);

	while (1 < dwIndexUpper - dwIndexLower)
	//----- _xZkqqHx_iPoDiMmAjCgMiBeBiJlKiMmAjCgMiCmMiNlHiCkKiCfBiImIiPoDiCmMiKnEiCmNiDiLiBfLiDhG_xHqqkZx_ -----
	{
		// _xZkqqHx_iPoDiMmAiCmGiJlKiMmAiCmMjCiGiKnEiCmMiDeDiDjDiDgGiDgCiDeOiDfIiCpAiOfKiPgPiBeC_xHqqkZx_
		const DWORD dwIndexMid = (dwIndexLower + dwIndexUpper) / 2;
		// _xZkqqHx_jCiGiKnEiCmMiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCpAiOfKiPgPiBeC_xHqqkZx_
		const flint fliPrimaryIdMid = GetRecordPrimaryId(dwIndexMid);
		// _xZkqqHx_iPoDiMmAiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iBeBiJlKiMmAiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCmGjEoEiKhCiClFiCmEiPoDiMmAiBeFiJlKiMmAiDeDiDjDiDgGiDgCiDeOiDfIiCpAjFmPiNfIiBeC_xHqqkZx_
		if (fliPrimaryIdMid < fliPrimaryId)
			dwIndexLower = dwIndexMid;
		else
			dwIndexUpper = dwIndexMid;
	}
	// _xZkqqHx_iPoDiMmAiDeDiDjDiDgGiDgCiDeOiDfIiCmGiJlKiMmAiDeDiDjDiDgGiDgCiDeOiDfIiCmMiNlHiCmNiCfAiBeCiCmHiClPiCoHiCkJiCmJjCgMiCkKiCkAiCoJiCmNiClIiBeC_xHqqkZx_
	// _xZkqqHx_iJlKiMmAiCmMiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCpAiOfKiPgPiBeC_xHqqkZx_
	const flint fliPrimaryIdLower = GetRecordPrimaryId(dwIndexLower);
	// _xZkqqHx_iJlKiMmAiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCmGjEoEiKhCiBeC_xHqqkZx_
	return (fliPrimaryIdLower < fliPrimaryId) ? dwIndexUpper : dwIndexLower;
} // FCVirtualTable::PrimaryIdToLowerBoundIndex.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCVirtualTable::PrimaryIdToUpperBoundIndex
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCoGiCoIjBoFiCkLiCkCiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCpAiOjNiCmCiNmFiPiJiCmM_xHqqkZx_
 *			_xZkqqHx_iDiMiDfCiBfLiDgIiCpAiMjPiNpFiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	fliPrimariId	:_xZkqqHx_iDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDiMiDfCiBfLiDgIiDeDiDjDiDgGiDgCiDeOiDfIiBeCiMkJiCmCiCkJiCoHiCmIiCkCiPoKiNiHiCmN_xHqqkZx_ DWORD(-1)_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	_xZkqqHx_iDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCkKiPlIiPiHiCmJiDfMiBfLiDgHiClDiCoKiCmEiCkCiCoJiPoKiNiHiCmMiCnNjHeMiMpIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iJlKjAhNiCmJjHoBiCpAiOkGiClHiBeC_xHqqkZx_
 *
 *			_xZkqqHx_iEkBiEjPiEkGiEjPiEkGiEjPiEkGiEjPiEkGiEjPiEkGiEjPiEkGiEjPiEkGiEjPiEkGiEjPiEkGiEjPiEkGiEjPiEkC_xHqqkZx_
 *			_xZkqqHx_iEkA_xHqqkZx_ 4_xZkqqHx_iEkA_xHqqkZx_ 4_xZkqqHx_iEkA_xHqqkZx_ 6_xZkqqHx_iEkA_xHqqkZx_ 6_xZkqqHx_iEkA_xHqqkZx_ 7_xZkqqHx_iEkA_xHqqkZx_ 7_xZkqqHx_iEkA_xHqqkZx_ 7_xZkqqHx_iEkA_xHqqkZx_ 8_xZkqqHx_iEkA_xHqqkZx_ 8_xZkqqHx_iEkA_xHqqkZx_ 9_xZkqqHx_iEkA_xHqqkZx_ 9_xZkqqHx_iEkA_xHqqkZx_
 *			_xZkqqHx_iEkFiEjPiEkJiEjPiEkJiEjPiEkJiEjPiEkJiEjPiEkJiEjPiEkJiEjPiEkJiEjPiEkJiEjPiEkJiEjPiEkJiEjPiEkH_xHqqkZx_
 *			   0   1   2   3   4   5   6   7   8   9  10
 *
 *			-------------------------------------------------------------
 *			6 _xZkqqHx_iCpAiMjPiNpFiClHiCoJiPoKiNiHiBeC_xHqqkZx_
 *			L_INDEX = 0  H_INDEX = 10
 *			(0 + 10) / 2 = 5
 *			5->7 6_xZkqqHx_jClEiJhKiCmIiCmMiCmF_xHqqkZx_ H_INDEX = 5
 *			(0 + 5) / 2 = 2
 *			2->6 6_xZkqqHx_iImIiJlKiCmIiCmMiCmF_xHqqkZx_ L_INDEX = 2
 *			(2 + 5) / 2 = 3
 *			3->6 6_xZkqqHx_iImIiJlKiCmIiCmMiCmF_xHqqkZx_ L_INDEX = 3
 *			(3 + 5) / 2 = 4
 *			4->7 6_xZkqqHx_jClEiJhKiCmIiCmMiCmF_xHqqkZx_ H_INDEX = 4
 *			L_INDEX = 3, H_INDEX = 4_xZkqqHx_iBeC_xHqqkZx_3->6 6_xZkqqHx_iImIiJlKiCmIiCmMiCmF_xHqqkZx_ ANS = 4
 *			-------------------------------------------------------------
 *			7 _xZkqqHx_iCpAiMjPiNpFiClHiCoJiPoKiNiHiBeC_xHqqkZx_
 *			L_INDEX = 0  H_INDEX = 10
 *			(0 + 10) / 2 = 5
 *			5->7 7_xZkqqHx_iImIiJlKiCmIiCmMiCmF_xHqqkZx_ L_INDEX = 5
 *			(5 + 10) / 2 = 7
 *			7->8 7_xZkqqHx_jClEiJhKiCmIiCmMiCmF_xHqqkZx_ H_INDEX = 7
 *			(5 + 7) / 2 = 6
 *			6->7 7_xZkqqHx_iImIiJlKiCmIiCmMiCmF_xHqqkZx_ L_INDEX = 6
 *			L_INDEX = 6, H_INDEX = 7_xZkqqHx_iBeC_xHqqkZx_6->7 7_xZkqqHx_iImIiJlKiCmIiCmMiCmF_xHqqkZx_ ANS = 7
 *			-------------------------------------------------------------
 *			2 _xZkqqHx_iCpAiMjPiNpFiClHiCoJiPoKiNiHiBeC_xHqqkZx_
 *			L_INDEX = 0  H_INDEX = 10
 *			(0 + 10) / 2 = 5
 *			5->7 2_xZkqqHx_jClEiJhKiCmIiCmMiCmF_xHqqkZx_ H_INDEX = 5
 *			(0 + 5) / 2 = 2
 *			2->6 2_xZkqqHx_jClEiJhKiCmIiCmMiCmF_xHqqkZx_ H_INDEX = 2
 *			(0 + 2) / 2 = 1
 *			1->4 2_xZkqqHx_jClEiJhKiCmIiCmMiCmF_xHqqkZx_ H_INDEX = 1
 *			L_INDEX = 0, H_INDEX = 1_xZkqqHx_iBeC_xHqqkZx_0->4 2_xZkqqHx_jClEiJhKiCmIiCmMiCmF_xHqqkZx_ ANS = 0
 *			-------------------------------------------------------------
 *			11 _xZkqqHx_iCpAiMjPiNpFiClHiCoJiPoKiNiHiBeC_xHqqkZx_
 *			L_INDEX = 0  H_INDEX = 10
 *			(0 + 10) / 2 = 5
 *			5->7 11_xZkqqHx_iImIiJlKiCmIiCmMiCmF_xHqqkZx_ L_INDEX = 5
 *			(5 + 10) / 2 = 7
 *			7->8 11_xZkqqHx_iImIiJlKiCmIiCmMiCmF_xHqqkZx_ L_INDEX = 7
 *			(7 + 10) / 2 = 8
 *			8->8 11_xZkqqHx_iImIiJlKiCmIiCmMiCmF_xHqqkZx_ L_INDEX = 8
 *			(8 + 10) / 2 = 9
 *			9->9 11_xZkqqHx_iImIiJlKiCmIiCmMiCmF_xHqqkZx_ L_INDEX = 9
 *			L_INDEX = 9, H_INDEX = 10_xZkqqHx_iBeC_xHqqkZx_9->9 11_xZkqqHx_iImIiJlKiBeB_xHqqkZx_10->9 11_xZkqqHx_iImIiJlKiCmIiCmMiCmF_xHqqkZx_ ANS = -1
 *			-------------------------------------------------------------
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
DWORD FCVirtualTable::PrimaryIdToUpperBoundIndex (flint fliPrimaryId) const
{
	// _xZkqqHx_iDiMiDfCiBfLiDgIjAjEiCkKiCePiCmMiPoKiNiHiCmNiDeHiDiJiBfLjCgM_xHqqkZx_ DWORD(-1)_xZkqqHx_iBeC_xHqqkZx_
	if (GetRecordCount() == 0)
		return DWORD(-1);
	// _xZkqqHx_iJlKiMmAjCgMiDeDiDjDiDgGiDgCiDeOiDfIiBeC_xHqqkZx_
	DWORD dwIndexLower = 0;
	// _xZkqqHx_iPoDiMmAjCgMiDeDiDjDiDgGiDgCiDeOiDfIiBeC_xHqqkZx_
	DWORD dwIndexUpper = GetRecordCount() - 1;
	// _xZkqqHx_iPoDiMmAjCgMiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
	const flint fliPrimaryIdUpper = GetRecordPrimaryId(dwIndexUpper);

	// _xZkqqHx_iOhHjCoIiCmMiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCkKiPoDiMmAjCgMiCmJjDpMiCoJiCkJjClCiCnHiCoJiBeC_xHqqkZx_
	// _xZkqqHx_jDpMiCoHiCmIiCkCiPoKiNiHiCmNiDeHiDiJiBfLjCgM_xHqqkZx_ DWORD(-1)_xZkqqHx_iBeC_xHqqkZx_
	if (fliPrimaryIdUpper <= fliPrimaryId)
		return DWORD(-1);

	while (1 < dwIndexUpper - dwIndexLower)
	//----- _xZkqqHx_iPoDiMmAjCgMiBeBiJlKiMmAjCgMiCmMiNlHiCkKiCfBiImIiPoDiCmMiKnEiCmNiDiLiBfLiDhG_xHqqkZx_ -----
	{
		// _xZkqqHx_iPoDiMmAiCmGiJlKiMmAiCmMjCiGiKnEiCmMiDeDiDjDiDgGiDgCiDeOiDfIiCpAiOfKiPgPiBeC_xHqqkZx_
		const DWORD dwIndexMid = (dwIndexLower + dwIndexUpper) / 2;
		// _xZkqqHx_jCiGiKnEiCmMiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCpAiOfKiPgPiBeC_xHqqkZx_
		const flint fliPrimaryIdMid = GetRecordPrimaryId(dwIndexMid);
		// _xZkqqHx_iPoDiMmAiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iBeBiJlKiMmAiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCmGjEoEiKhCiClFiCmEiPoDiMmAiBeFiJlKiMmAiDeDiDjDiDgGiDgCiDeOiDfIiCpAjFmPiNfIiBeC_xHqqkZx_
		if (fliPrimaryIdMid <= fliPrimaryId)
			dwIndexLower = dwIndexMid;
		else
			dwIndexUpper = dwIndexMid;
	}
	// _xZkqqHx_iPoDiMmAiDeDiDjDiDgGiDgCiDeOiDfIiCmGiJlKiMmAiDeDiDjDiDgGiDgCiDeOiDfIiCmMiNlHiCmNiCfAiBeCiCmHiClPiCoHiCkJiCmJjCgMiCkKiCkAiCoJiCmNiClIiBeC_xHqqkZx_
	// _xZkqqHx_iJlKiMmAiCmMiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCpAiOfKiPgPiBeC_xHqqkZx_
	const flint fliPrimaryIdLower = GetRecordPrimaryId(dwIndexLower);
	// _xZkqqHx_iJlKiMmAiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCmGjEoEiKhCiBeC_xHqqkZx_
	return (fliPrimaryIdLower <= fliPrimaryId) ? dwIndexUpper : dwIndexLower;
} // FCVirtualTable::PrimaryIdToUpperBoundIndex.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCVirtualTable::PrimaryIdToIndex
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCmGjDkPiClGiDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCpAiOjNiCmCiNmFiPiJiCmM_xHqqkZx_
 *			_xZkqqHx_iDiMiDfCiBfLiDgIiCmMiDeDiDjDiDgGiDgCiDeOiDfIiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	fliPrimaryId	:_xZkqqHx_iDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDiMiDfCiBfLiDgIiDeDiDjDiDgGiDgCiDeOiDfIiBeCiMkJiCmCiCkJiCoHiCmIiCkCiPoKiNiHiCmN_xHqqkZx_DWORD(-1)_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	_xZkqqHx_iDhGiDiJiDeDiDhNiDiKiBfL_xHqqkZx_ID_xZkqqHx_iCkKiPlIiPiHiCmJiDfMiBfLiDgHiClDiCoKiCmEiCkCiCoJiPoKiNiHiCmMiCnNjHeMiMpIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.02.13 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
DWORD FCVirtualTable::PrimaryIdToIndex (flint fliPrimaryId) const
{
	// LowerBound_xZkqqHx_iDeDiDjDiDgGiDgCiDeOiDfIiCpAiLiBiCnPiCoJiBeC_xHqqkZx_
	const DWORD dwIndex = PrimaryIdToLowerBoundIndex(fliPrimaryId);
	if (dwIndex != DWORD(-1) &&
		GetRecordPrimaryId(dwIndex) == fliPrimaryId)
		return dwIndex;
	return DWORD(-1);
} // FCVirtualTable::PrimaryIdToIndex.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCVirtualTable::MoveWriteRecordToReal
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgFiBfLiDhFiDiLiCmM_xHqqkZx_WRITE_xZkqqHx_iDiMiDfCiBfLiDgIiDeMiDiDiDgCiDfGiDiFiCpA_xHqqkZx_READ_xZkqqHx_iDiMiDfCiBfLiDgIiDeMiDiDiDgCiDfGiDiFiCnG_xHqqkZx_
 *			_xZkqqHx_iInKjDkOiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iDgGiBfLiDfOiCmNiDhBiBfLiDhGiCmJjDgPjIfOiClDiCoKiCmEiCkCiCoJiCmMiCmFiBeBiDhBiBfLiDhG_xHqqkZx_ID_xZkqqHx_iCpA_xHqqkZx_READ_xZkqqHx_iDiMiDfCiBfLiDgI_xHqqkZx_
 *			_xZkqqHx_iDeMiDiDiDgCiDfGiDiFiCnGiInKjDkOiClHiCoKiCmOiNmPiCnOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.02.12 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCVirtualTable::MoveWriteRecordToReal ()
{
	ResizeRealRecordCount(GetWriteRecordEnd());
	DWORD dwIndex;
	for (dwIndex = GetWriteRecordBegin(); dwIndex != GetWriteRecordEnd(); dwIndex++)
	//----- WRITE_xZkqqHx_iDiMiDfCiBfLiDgIiDeMiDiDiDgCiDfGiDiFiCpAiDiLiBfLiDhG_xHqqkZx_ -----
	{
		FCVirtualRecord& tableWriteRecord = GetTableWriteRecord(dwIndex);
		// WRITE_xZkqqHx_iDiMiDfCiBfLiDgIiCmMjCgMiCpA_xHqqkZx_READ_xZkqqHx_iDiMiDfCiBfLiDgIiCnGjFkBiOmKiBeC_xHqqkZx_
		SetRealRecord(	dwIndex,
						tableWriteRecord.m_fliPrimaryId,
						tableWriteRecord.m_dwAppendIdentifier,
						tableWriteRecord.m_dwSize,
						tableWriteRecord.m_dwDataId);
		// _xZkqqHx_iDhBiBfLiDhGiDgGiBfLiDfOiCmN_xHqqkZx_READ_xZkqqHx_iDgPiDgCiDhEiDeAiCmJjFkBiOmKiClHiCoJiClNiCnPiBeBjGlDiMpIjCgMiCpAjAnNjCoIiBeC_xHqqkZx_
		// _xZkqqHx_iClBiCkEiClFiCmIiCkCiCmGiBeBiJpAjFpKiClDiCoKiCmEiClFiCnMiCkEiBeC_xHqqkZx_
		tableWriteRecord.m_dwDataId = DWORD(-1);
	}
	// WRITE_xZkqqHx_iDgFiBfLiDhFiDiLiCpAiPiJiKpKiJlLiBeC_xHqqkZx_Identifier_xZkqqHx_iCmNjFmPiNfIiClFiCmIiCkCiBeC_xHqqkZx_
	ResetWriteRecordCache(	GetRealRecordEnd(),
							GetWriteDeleteIdentifier(),
							GetWriteAppendIdentifier());
} // FCVirtualTable::MoveWriteRecordToReal.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCVirtualTable::GetTableRecord
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiDeDiDjDiDgGiDgCiDeOiDfIiCmMiDiMiDfCiBfLiDgIiCpAiOoGjDlOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	dwIndex	:_xZkqqHx_iDiMiDfCiBfLiDgIiDeDiDjDiDgGiDgCiDeOiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDiMiDfCiBfLiDgIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiDeDiDjDiDgGiDgCiDeOiDfIiCmJ_xHqqkZx_WRITE_xZkqqHx_iDeMiDiDiDgCiDfGiDiFiCkKjHeMiCoJiPoKiNiHiCmNiBeB_xHqqkZx_
 *			WRITE_xZkqqHx_iJlMjBhKiDgFiBfLiDhFiDiLiCmMiDiMiDfCiBfLiDgIiCpAjFnEiClHiBeC_xHqqkZx_
 *			_xZkqqHx_iClLiCoKiImIiKePiCmMiPoKiNiHiCmNiBeB_xHqqkZx_REAL_xZkqqHx_iJlMjBhKiDgFiBfLiDhFiDiLiCmMiDiMiDfCiBfLiDgIiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.02.13 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
FCVirtualRecord& FCVirtualTable::GetTableRecord (DWORD dwIndex)
{
	if (IsWriteRecordInside(dwIndex))
		return GetTableWriteRecord(dwIndex);
	else
		return GetTableRealRecord(dwIndex);
} // FCVirtualTable::GetTableRecord.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCVirtualTable::GetTableRecord
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiDeDiDjDiDgGiDgCiDeOiDfIiCmMiDiMiDfCiBfLiDgIiCpAiOoGjDlOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	dwIndex	:_xZkqqHx_iDiMiDfCiBfLiDgIiDeDiDjDiDgGiDgCiDeOiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDiMiDfCiBfLiDgIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiDeDiDjDiDgGiDgCiDeOiDfIiCmJ_xHqqkZx_WRITE_xZkqqHx_iDeMiDiDiDgCiDfGiDiFiCkKjHeMiCoJiPoKiNiHiCmNiBeB_xHqqkZx_
 *			WRITE_xZkqqHx_iJlMjBhKiDgFiBfLiDhFiDiLiCmMiDiMiDfCiBfLiDgIiCpAjFnEiClHiBeC_xHqqkZx_
 *			_xZkqqHx_iClLiCoKiImIiKePiCmMiPoKiNiHiCmNiBeB_xHqqkZx_REAL_xZkqqHx_iJlMjBhKiDgFiBfLiDhFiDiLiCmMiDiMiDfCiBfLiDgIiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.02.13 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
const FCVirtualRecord& FCVirtualTable::GetTableRecord (DWORD dwIndex) const
{
	if (IsWriteRecordInside(dwIndex))
		return GetTableWriteRecord(dwIndex);
	else
		return GetTableRealRecord(dwIndex);
} // FCVirtualTable::GetTableRecord.

