/*************************************************************************
 * <_xZkqqHx_iDhEiDeAiDeDiDiL_xHqqkZx_> HiTerminateTable.cpp
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_> FCHiTerminateTable_xZkqqHx_iDeOiDiJiDfIiCmMiDeDiDjDiDhGiDiKiDiBiDjDiDgHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_> 02.03.31 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/

#include "stdafx.h"
// 06.01.12 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//#include "UtilMisc.h"			// For FFCalcCRC.
#include "UtilFile.h"			// For BYTEVector <<.
#include "UtilErr.h"			// For FFThrowDDFileException.
//#include "LockVar.h"			// For FCLockVar.
#include "DynamicDb.h"			// For g_pFileServer.
#include "HiProject.h"			// For FCHiProject.
#include "HiTerminateTable.h"	// This header.

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCHiTerminateTable::FCHiTerminateTable
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgGiDhEiDeIiDiLiDgHiDfCiDjDiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.10.21 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
FCHiTerminateTable::FCHiTerminateTable ()
{
	// _xZkqqHx_iPiJiKpKiJlLiCmMjFeLjHhGiCmIjFmPjAjEiCpAiPiJiKpKiJlLiBeC_xHqqkZx_
	Clear();
} // FCHiTerminateTable::FCHiTerminateTable.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCHiTerminateTable::FCHiTerminateTable
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.10 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
FCHiTerminateTable::FCHiTerminateTable (const FCDbGroup& dbGroup)
			:	BASE_CLASS()
{
	Clear();
	Set(dbGroup.GetGroupName().PushBack(FDHI_TERMINATE_TABLE_ID));
} // FCHiTerminateTable::FCHiTerminateTable.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCHiTerminateTable::~FCHiTerminateTable
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgGiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.10.30 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
FCHiTerminateTable::~FCHiTerminateTable ()
{
	if (IsOpened()) Clear();
} // FCHiTerminateTable::~FCHiTerminateTable.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCHiTerminateTable::operator =
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	
 *
 * <_xZkqqHx_iPnKiNnH_xHqqkZx_>	
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.10 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCHiTerminateTable::operator = (const FCDbGroup& dbGroup)
{
	Clear();
	Set(dbGroup.GetGroupName().PushBack(FDHI_TERMINATE_TABLE_ID));
} // FCHiTerminateTable::operator.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCHiTerminateTable::UpdateData
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFkKiKpCiDhEiDeAiDeDiDiLiCkKiNfIjAfGiClDiCoKiCmEiCkCiCoKiCmOiDiNiBfLiDgIiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	autoLockRead:_xZkqqHx_jFkKiKpCiDhEiDeAiDeDiDiLiCmMjDmHiCnNiNjOiCnNjHhAiOkJjDkOiDiNiDgCiDeOjFmPjAjEiCpAiOhHjCoIiBeC_xHqqkZx_
 *						 _xZkqqHx_iKpJiCmJiDiNiDgCiDeOiClDiCoKiCmEiCkCiCmIiCkPiCoKiCmOiCmIiCoHiCmIiCkCiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDiNiBfLiDgIiClDiCoKiClNiPoKiNiHiCmN_xHqqkZx_ TRUE_xZkqqHx_iBeBiClDiCoKiCmIiCkCiPoKiNiHiCmN_xHqqkZx_ FALSE _xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	_xZkqqHx_iDeHiDiJiBfLiOjOiCmNiBeB_xHqqkZx_CFCDDFileException,CFileException_xZkqqHx_jHoBiKePiCpAjEkNjAlGiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.03.19 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCHiTerminateTable::UpdateData (const FCDbReadLock& readLock)
{
	ASSERT(readLock.IsLocked());
	if (!BASE_CLASS::UpdateData(readLock))
	//----- _xZkqqHx_iPeDjAlDiCkKjDpMiCmBiCmEiCkCiCmIiCkCiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iPeDjAlDiCkKjDpMiCmBiCmEiCkCiCmIiCkPiCoKiCmOjFjMiLeBiBeC_xHqqkZx_
		return FALSE;
	} else
	//----- _xZkqqHx_iPeDjAlDiCkKjDpMiCmBiCmEiCkCiCoJiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iPeJjCfLiImKjChFiBeCjGkCiDiNiDgCiDeOiOjOiCmJjHjIjHhAiBeC_xHqqkZx_
		m_fliEndSessionIndexAbout = SeeEndSessionIndex();
		return TRUE;
	}
} // FCHiTerminateTable::UpdateData.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCHiTerminateTable::Clear
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jBfDiPoOjFpBiCpAiDeOiDiKiDeBiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.03.19 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCHiTerminateTable::Clear ()
{
	// Baseclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::Clear();
	m_fliEndSessionIndexAbout = -1;			// _xZkqqHx_iPeJjCfLiImKjChFiBeCjGkCiDiNiDgCiDeOiOjOiCmJjHjIjHhAiBeC_xHqqkZx_
} // FCHiTerminateTable::Clear.

//----- 06.01.15 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCHiTerminateTable::OpenExisting
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iKpJjBlGiCmMjHjKjHpAiImKjChFiDhEiDeAiDeDiDiLiCpAiBeBjCmHiJmBiPpDjBnEiCmFiKeKiCkNiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	tcpFile	:_xZkqqHx_jHjKjHpAiImKjChFiDhEiDeAiDeDiDiLjGlMiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jCiNiInD_xHqqkZx_>	_xZkqqHx_iDeHiDiJiBfLiOjOiCmNjHoBiKePiCpAjEkNjAlGiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	02.03.31 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCHiTerminateTable::OpenExisting (const FCHiProject& project, long lDocId)
//{
//	// _xZkqqHx_iDgFiBfLiDhFiDiLiCpAjAnNjCoIiBeC_xHqqkZx_
//	Initialize(project.GetSubTableName(lDocId, FDHI_TERMINATE_TABLE_ID));
//} // FCHiTerminateTable::OpenExisting.
//----- 06.01.15 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

//----- 06.01.16 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCHiTerminateTable::Clear
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jBfDiCmEiCmMiPoOjFpBiCpAiDeOiDiKiDeBiClHiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.15 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCHiTerminateTable::Clear ()
//{
//	// Baseclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
//	BASE_CLASS::Clear();
//	// _xZkqqHx_iDgFiBfLiDhFiDiL_xHqqkZx_GUID_xZkqqHx_iCpAiPiJiKpKiJlLiBeC_xHqqkZx_
//	m_guidTableGuid = GUID_NULL;
//	// _xZkqqHx_iNoNiPjM_xHqqkZx_ID_xZkqqHx_iCmGjCmHiJmB_xHqqkZx_ID_xZkqqHx_iCpAiPiJiKpKiJlLiBeC_xHqqkZx_
//	m_dwLockedDeleteIdentifier = DWORD(-1);
//	m_dwLockedAppendIdentifier = DWORD(-1);
//} // FCHiTerminateTable::Clear.
//----- 06.01.16 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

//----- 06.02.07 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCHiTerminateTable::Close
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iKeKiCkCiCmEiCkCiCoJjHjKjHpAiImKjChFiDhEiDeAiDeDiDiLiCpAjFmCiClGiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	02.03.31 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCHiTerminateTable::Close ()
//{
//	// _xZkqqHx_iPiJiKpKiJlLiCmMjFeLjHhGiCmIjFmPjAjEiCpAiPiJiKpKiJlLiBeC_xHqqkZx_
//	Clear();
//} // FCHiTerminateTable::Close.
//----- 06.02.07 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

//----- 06.02.07 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCHiTerminateTable::ReOpen
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhEiDeAiDeDiDiLiCpAiIoKjDhIjFmCiClGiCmEiBeBjDkPiClGiPpDjBnEiCmFiNmEjDhIiKeKiCkNiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iDhEiDeAiDeDiDiLiCkKjBlMiCmMiDeBiDhGiDiKiCmFiNfIjAfGiClDiCoKiClNiPoKiNiHiCmIiCmHiBeB_xHqqkZx_
// *			CFCHIFSFile _xZkqqHx_iCmNiClLiCmMjFmPiNfIiCpAjAlDiClFiCkNjEeGiOkPiCmFiCkLiCmIiCkCiBeC_xHqqkZx_
// *			_xZkqqHx_iBgJiDhEiDeAiDeDiDiLiDfEiDeDiDfJiPoOjFpBiCmIiCmHiCpAiDiBiDiCiDiKiCmJiCoAiCmBiCmEiCkCiCoJiClNiCnPiBgK_xHqqkZx_
// *			_xZkqqHx_iClBiCmMiClNiCnPiBeBiClBiCmMiPiIjHjNiCkKjFeLjHhGiCmGiCmIiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.12.07 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCHiTerminateTable::ReOpen ()
//{
//	// _xZkqqHx_iNfIjAfGiDeKiDeFiDjDiDfOiCpAiDiKiDfKiDgCiDgHiBeC_xHqqkZx_
//	ResetVirtualTableIdentifier();
//} // FCHiTerminateTable::ReOpen.
//----- 06.02.07 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCHiTerminateTable::IsOpened
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhEiDeAiDeDiDiLiCkKiKeKiCkCiCmEiCkCiCoJiCkJiCmHiCkEiCkJiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iKeKiCkCiCmEiCkCiCoJiPoKiNiHiCmN_xHqqkZx_ TRUE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.07.31 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCHiTerminateTable::IsOpened () const
{
	return !GetIsInvalid();
} // FCHiTerminateTable::IsOpened.

//----- 06.01.16 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCHiTerminateTable::IsRealTableReplaced
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiNiDgCiDeOiClDiCoKiCmEiCkCiCoJiDhEiDeAiDeDiDiLiCkKiBeBjBlMiCmMiDeBiDeOiDfKiDfIiCmFjChFiKlHiClDiCoKiClNiCkJ_xHqqkZx_
// *			_xZkqqHx_iCmHiCkEiCkJiCpAjClCiCnHiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jChFiKlHiClDiCoKiCmEiCkCiCoJiPoKiNiHiCmN_xHqqkZx_TRUE_xZkqqHx_iBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.15 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//BOOL FCHiTerminateTable::IsRealTableReplaced () const
//{
//	return (m_guidTableGuid != g_pFileServer->GetLockedTableGuid(GetTableName()));
//} // FCHiTerminateTable::IsRealTableReplaced.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCHiTerminateTable::IsRealTableRecordDeleted
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiNiDgCiDeOiClDiCoKiCmEiCkCiCoJiDhEiDeAiDeDiDiLiCkKiBeBjBlMiCmMiDeBiDeOiDfKiDfIiCmFiPoDiPjBiCkLiNfIjAfGiClDiCoKiClNiCkJ_xHqqkZx_
// *			_xZkqqHx_iCmHiCkEiCkJiCpAjClCiCnHiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iNfIjAfGiClDiCoKiCmEiCkCiCoJiPoKiNiHiCmN_xHqqkZx_TRUE_xZkqqHx_iBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.12.10 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//BOOL FCHiTerminateTable::IsRealTableRecordDeleted () const
//{
//	return (m_dwLockedDeleteIdentifier != g_pFileServer->GetLockedDeleteIdentifier(GetTableName()));
//} // FCHiTerminateTable::IsRealTableRecordDeleted.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCHiTerminateTable::IsRealTableRecordAppended
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiNiDgCiDeOiClDiCoKiCmEiCkCiCoJiDhEiDeAiDeDiDiLiCkKiBeBjBlMiCmMiDeBiDeOiDfKiDfIiCmFjCmHiJmBiNfIjAfGiClDiCoKiClNiCkJ_xHqqkZx_
// *			_xZkqqHx_iCmHiCkEiCkJiCpAjClCiCnHiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iNfIjAfGiClDiCoKiCmEiCkCiCoJiPoKiNiHiCmN_xHqqkZx_TRUE_xZkqqHx_iBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.12.10 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//BOOL FCHiTerminateTable::IsRealTableRecordAppended () const
//{
//	return (m_dwLockedAppendIdentifier != g_pFileServer->GetLockedAppendIdentifier(GetTableName()));
//} // FCHiTerminateTable::IsRealTableRecordAppended.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCHiTerminateTable::IsRealTableRecordModified
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiNiDgCiDeOiClDiCoKiCmEiCkCiCoJiDhEiDeAiDeDiDiLiCkKiBeBjBlMiCmMiDeBiDeOiDfKiDfIiCmFjCmHiJmBiNfIjAfG_xHqqkZx_ _xZkqqHx_iIlNiCkCiCmN_xHqqkZx_
// *			_xZkqqHx_iPoDiPjBiCkLiNfIjAfGiClDiCoKiClNiCkJiCmHiCkEiCkJiCpAjClCiCnHiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iNfIjAfGiClDiCoKiCmEiCkCiCoJiPoKiNiHiCmN_xHqqkZx_TRUE_xZkqqHx_iBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.12.10 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//BOOL FCHiTerminateTable::IsRealTableRecordModified () const
//{
//	return (IsRealTableRecordDeleted() || IsRealTableRecordAppended());
//} // FCHiTerminateTable::IsRealTableRecordModified.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCHiTerminateTable::ResetVirtualTableIdentifier
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiNiDgCiDeOiClDiCoKiCmEiCkCiCoJiDhEiDeAiDeDiDiLiCmMiBeBjCmHiJmBiNfIjAfGiDeKiDeFiDjDiDfOiCmGiPoDiPjBiCkLiNfIjAfGiDeKiDeFiDjDiDfO_xHqqkZx_
// *			_xZkqqHx_iCpAiDiKiDfKiDgCiDgHiClHiCoJiBeC_xHqqkZx_
// *			_xZkqqHx_iDiBiDiCiDiKjCiGiCmMiDeKiDeFiDjDiDfOjCgMiCmNiBeBiDiNiDgCiDeOiDhEiDeAiDeDiDiLjCiGiCmMiDeKiDeFiDjDiDfOiCmJ_xHqqkZx_
// *			_xZkqqHx_jCgMiCpAiNiHiCoNiClJiCoHiCoKiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.12.10 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCHiTerminateTable::ResetVirtualTableIdentifier ()
//{
//	// _xZkqqHx_iDgFiBfLiDhFiDiL_xHqqkZx_GUID_xZkqqHx_iCpAjAnNjCoIiBeC_xHqqkZx_
//	m_guidTableGuid = g_pFileServer->GetLockedTableGuid(GetTableName());
//	// _xZkqqHx_iNoNiPjM_xHqqkZx_ID_xZkqqHx_iCmGjCmHiJmB_xHqqkZx_ID_xZkqqHx_iCpAjAnNjCoIiBeC_xHqqkZx_
//	m_dwLockedDeleteIdentifier = g_pFileServer->GetLockedDeleteIdentifier(GetTableName());
//	m_dwLockedAppendIdentifier = g_pFileServer->GetLockedAppendIdentifier(GetTableName());
//} // FCHiTerminateTable::ResetVirtualTableIdentifier.
//----- 06.01.16 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCHiTerminateTable::UpdateEndSessionIndex
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jHjKjHpAiImKjChFiDhEiDeAiDeDiDiLiCmMiPeJjCfLiCpAiNfIjAfGiBeCiPeJjCfLiCkKjBlGiNnNiClFiCmIiCkCiPoKiNiHiCmN_xHqqkZx_
 *			_xZkqqHx_jCmHiJmBiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	fliSessionIndex:_xZkqqHx_iDfKiDgCiDfGiDiHiDjDjHjKjHpAiImKjChFiCpAiOhHjCoIiBeC_xHqqkZx_
 *			fliCmdPtr		:_xZkqqHx_jHjKjHpAiDhEiDeAiDeDiDiLiImKjChFiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	02.03.31 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCHiTerminateTable::UpdateEndSessionIndex (flint fliSessionIndex,
												const BYTE* pStream,
												DWORD dwStreamSize)
{
	if (GetRecordCount() != 0)
		ReduceRecordCount(0);
	AppendRecord(fliSessionIndex, pStream, dwStreamSize);
//----- 06.02.09 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	// _xZkqqHx_iPeJjCfLiImKjChFiBeCjGkCiDiNiDgCiDeOiOjOiCmJjHjIjHhAiBeC_xHqqkZx_
	m_fliEndSessionIndexAbout = fliSessionIndex;
//----- 06.02.09 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
//----- 06.02.07 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	// _xZkqqHx_iJlMjBhKiDgFiBfLiDhFiDiLiCmM_xHqqkZx_Identifier_xZkqqHx_iCpAiLeMjIfOiClFiClNjFmPjAjEiCpAiDiKiDfKiDgCiDgHiClHiCoJiBeC_xHqqkZx_
	ResetVirtualTableIdentifier();
//----- 06.02.07 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

//	TRACE(_T("FCHiTerminateTable::UpdateEndSessionIndex %d : %I64d\n"), GetRecordAppendIdentifier(0), fliSessionIndex);

} // FCHiTerminateTable::UpdateEndSessionIndex.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCHiTerminateTable::SeeEndSessionIndex
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iPeJjCfLiDiMiDfCiBfLiDgIiCmJiLeMjIfOiClDiCoKiClNiPoOjFpBiCpAiMkJiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDfKiDgCiDfGiDiHiDjDiDeDiDjDiDgGiDgCiDeOiDfIiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.10.19 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
flint FCHiTerminateTable::SeeEndSessionIndex ()
{
	return GetRecordPrimaryId(0);
} // FCHiTerminateTable::SeeEndSessionIndex.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCHiTerminateTable::SeeLastFlushedEndSessionIndex
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFkIjHjNiDgFiBfLiDhFiDiLiCmMiPeJjCfLiDiMiDfCiBfLiDgIiCmJiLeMjIfOiClDiCoKiClNiPoOjFpBiCpAiMkJiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDfKiDgCiDfGiDiHiDjDiDeDiDjDiDgGiDgCiDeOiDfIiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.03.10 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
flint FCHiTerminateTable::SeeLastFlushedEndSessionIndex ()
{
	return GetRealRecordPrimaryId(0);
} // FCHiTerminateTable::SeeLastFlushedEndSessionIndex.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCHiTerminateTable::SeeEndSessionIndexAbout
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iPeJjCfLiDiMiDfCiBfLiDgIiCmJiLeMjIfOiClDiCoKiClNiPoOjFpBiCpAiMkJiCoJiBeCjGkCiDiNiDgCiDeOiOjOiCmNiNmFiMoDiCmJiDiNiDgCiDeO_xHqqkZx_
 *			_xZkqqHx_iClDiCoKiClNiCmGiCkLiCmMjCgMiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDfKiDgCiDfGiDiHiDjDiDeDiDjDiDgGiDgCiDeOiDfIiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.10.19 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
flint FCHiTerminateTable::SeeEndSessionIndexAbout ()
{
	if (GetIsReadLocked())
		return SeeEndSessionIndex();
	else
		return m_fliEndSessionIndexAbout;
} // FCHiTerminateTable::SeeEndSessionIndexAbout.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCHiTerminateTable::IsThereEndSessionSpot
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iPeJjCfLiDiMiDfCiBfLiDgIiCmJiDfIiDhMiDgCiDgHiDfIiDgHiDiKiBfLiDiAiCkKjBlGiNnNiClHiCoJiCkJjClCiCnHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jBlGiNnNiClHiCoJiPoKiNiHiCmN_xHqqkZx_TRUE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.25 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCHiTerminateTable::IsThereEndSessionSpot ()
{
	return (GetRecordDataSize(0) != 0);
} // FCHiTerminateTable::IsThereEndSessionSpot.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCHiTerminateTable::SeeEndSessionSpotStream
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iPeJjCfLiDiMiDfCiBfLiDgIiCmJiLeMjIfOiClDiCoKiClNiBeBiDfIiDhMiDgCiDgHiDfIiDgHiDiKiBfLiDiAiCpAiMkJiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDfIiDhMiDgCiDgHiDfIiDgHiDiKiBfLiDiAiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.01.15 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
FC2Fold<BYTE*, DWORD> FCHiTerminateTable::SeeEndSessionSpotStream ()
{
	DWORD dwDataSize = GetRecordDataSize(0);
	if (dwDataSize == 0)
		return FC2Fold<BYTE*, DWORD>(NULL, 0);
	BYTE* pData = new BYTE[dwDataSize];
	GetRecordData(pData, dwDataSize, 0);
	return FC2Fold<BYTE*, DWORD>(pData, dwDataSize);
} // FCHiTerminateTable::SeeEndSessionSpotStream.
