#ifndef __3ObjIDTbl_h
#define __3ObjIDTbl_h

/*********************************************************************
 *
 *	DWORD_xZkqqHx_iMfOiCmM_xHqqkZx_ID_xZkqqHx_iCpAiOjNiCmCiDeJiDhFiDfHiDeGiDeOiDgHiCpAiKmHjHjNiClHiCoJiDeOiDiJiDfIiBeC_xHqqkZx_
 *	_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCmM_xHqqkZx_ID_xZkqqHx_iCmGiDeJiDhFiDfHiDeGiDeOiDgHiDhMiDeDiDjDiDfOiCmMiDgFiBfLiDhFiDiLiCpAiKmHjHjNiClHiCoJiBeC_xHqqkZx_
 *	_xZkqqHx_iHeA_xHqqkZx_ ID_xZkqqHx_iCkKjEpCiCnBjEpCiCnBiCmJiCmIiCmBiCmEiCoAiKmHjHjNiDgFiBfLiDhFiDiLiCkKiDiBiDiCiDiKiCpAjIfBjEoPiClFiCmIiCkCiCoGiCkEiCmJiClHiCoJiBeC_xHqqkZx_
 *	_xZkqqHx_iHeB_xHqqkZx_ ObjectID_xZkqqHx_iCkJiCoH_xHqqkZx_FDObjVoid_xZkqqHx_iDhMiDeDiDjDiDfOiCnGiCmMiNiCjBkMjFmPiKlHiBeC_xHqqkZx_
 *	_xZkqqHx_iHeC_xHqqkZx_ ObjectID_xZkqqHx_iCkKiDiGiDgKiBfLiDeOiCmJiCmIiCoJiCoGiCkEiCmJiKmHjHjNiClHiCoJiBeC_xHqqkZx_
 *
 *	ObjectID_xZkqqHx_iCmN_xHqqkZx_unsigned_xZkqqHx_iCmM_xHqqkZx_32Bit_xZkqqHx_jAkOjAjEiBeC_xHqqkZx_
 *
 *    0x X X  X X  X X  X X
 *       ---  ------ ------
 *      Tbl0   Tbl1   Tbl2
 *

                    Tbl0        Tbl1         Tbl2
                     _xZkqqHx_iBkL_xHqqkZx_          _xZkqqHx_iBkL_xHqqkZx_           _xZkqqHx_iBkL_xHqqkZx_
	ObjIDTbl_xZkqqHx_iEkG_xHqqkZx_Table0[00]_xZkqqHx_iEkG_xHqqkZx_Table1[000]_xZkqqHx_iEkG_xHqqkZx_Table2[000]
			_xZkqqHx_iEkA_xHqqkZx_          _xZkqqHx_iEkA_xHqqkZx_           _xZkqqHx_iEkF_xHqqkZx_  _xZkqqHx_iBeG_xHqqkZx_
			_xZkqqHx_iEkA_xHqqkZx_          _xZkqqHx_iEkA_xHqqkZx_           _xZkqqHx_iEkE_xHqqkZx_Table2[fff]
			_xZkqqHx_iEkA_xHqqkZx_          _xZkqqHx_iEkF_xHqqkZx_  _xZkqqHx_iBeG_xHqqkZx_
			_xZkqqHx_iEkA_xHqqkZx_          _xZkqqHx_iEkE_xHqqkZx_Table1[fff]_xZkqqHx_iEkG_xHqqkZx_Table2[000]
			_xZkqqHx_iEkA_xHqqkZx_                       _xZkqqHx_iEkF_xHqqkZx_  _xZkqqHx_iBeG_xHqqkZx_
			_xZkqqHx_iEkA_xHqqkZx_                       _xZkqqHx_iEkE_xHqqkZx_Table2[fff]
			_xZkqqHx_iEkF_xHqqkZx_  _xZkqqHx_iBeG_xHqqkZx_
			_xZkqqHx_iEkE_xHqqkZx_Table0[ff]_xZkqqHx_iEkG_xHqqkZx_Table1[000]_xZkqqHx_iEkG_xHqqkZx_Table2[000]
			            _xZkqqHx_iEkA_xHqqkZx_           _xZkqqHx_iEkF_xHqqkZx_  _xZkqqHx_iBeG_xHqqkZx_
			            _xZkqqHx_iEkA_xHqqkZx_           _xZkqqHx_iEkE_xHqqkZx_Table2[fff]
			            _xZkqqHx_iEkF_xHqqkZx_  _xZkqqHx_iBeG_xHqqkZx_
			            _xZkqqHx_iEkE_xHqqkZx_Table1[fff]_xZkqqHx_iEkG_xHqqkZx_Table2[000]
			                         _xZkqqHx_iEkF_xHqqkZx_  _xZkqqHx_iBeG_xHqqkZx_
			                         _xZkqqHx_iEkE_xHqqkZx_Table2[fff]


 ********************************************************************/

class MC3ObjIDTbl;
class MC3ObjIDTbl1;
class MC3ObjIDTbl2;

#define TBL1_SIZE	0x100
#define TBL2_SIZE	0x1000
#define TBL3_SIZE	0x1000

class MC3ObjIDTbl
{
public:
	MC3ObjIDTbl ();
	~MC3ObjIDTbl ();
	DWORD	Register (void* pObj);
	void	Register (void* pObj, DWORD dwID);
	void	Unregister (DWORD dwID);
	void	ClearAll ();
	void*	IDtoObject (DWORD dwID) const;
	BOOL	IsEmpty () const;
	DWORD	GetFirstID () const;
	DWORD	GetNextID (DWORD dwID) const;

private:
	MC3ObjIDTbl1*	m_pTable[TBL1_SIZE];
};

class MC3ObjIDTbl1
{
public:
	MC3ObjIDTbl1 ();
	~MC3ObjIDTbl1 ();
	DWORD	Register (void* pObj);
	void	Register (void* pObj, DWORD dwID);
	void	Unregister (DWORD dwID);
	void	ClearAll ();

private:
friend class MC3ObjIDTbl;
	WORD			m_wVacantC;	// _xZkqqHx_iLpDiCkLiCkKjHeMiCoJ_xHqqkZx_m_pTable_xZkqqHx_iCmMjAjEiBeC_xHqqkZx_
	WORD			m_wUsedC;	// _xZkqqHx_iOgHiCoNiCoKiCmEiCkCiCoJ_xHqqkZx_m_pTable_xZkqqHx_iCmMjAjEiBeC_xHqqkZx_
	MC3ObjIDTbl2*	m_pTable[TBL2_SIZE];
};

class MC3ObjIDTbl2
{
public:
	MC3ObjIDTbl2 ();
	~MC3ObjIDTbl2 ();
	DWORD	Register (void* pObj);
	void	Register (void* pObj, DWORD dwID);
	void	Unregister (DWORD dwID);
	void	ClearAll ();

private:
friend class MC3ObjIDTbl;
friend class MC3ObjIDTbl1;
	WORD	m_wCount;	// m_pTable_xZkqqHx_iCmMiLpDiCkLjAjEiBeC_xHqqkZx_
	void*	m_pTable[TBL3_SIZE];
};

#endif//__3ObjIDTbl_h

