37 lines
651 B
C
37 lines
651 B
C
|
|
#ifndef _WH_ALLOCATION_ID_H_
|
|||
|
|
#define _WH_ALLOCATION_ID_H_
|
|||
|
|
|
|||
|
|
#include <deque>
|
|||
|
|
#include <map>
|
|||
|
|
|
|||
|
|
#include "ServiceCoreHead.h"
|
|||
|
|
|
|||
|
|
using std::deque;
|
|||
|
|
using std::map;
|
|||
|
|
|
|||
|
|
class SERVICE_CORE_CLASS WHAllocationID
|
|||
|
|
{
|
|||
|
|
private:
|
|||
|
|
CCriticalSection m_CriticalSection; //ͬ<><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
|||
|
|
deque<int> m_allocationIDQueue; //<2F><><EFBFBD><EFBFBD>ID<49><44>queue;
|
|||
|
|
map < int, bool > m_allocationIDMap; //<2F><><EFBFBD><EFBFBD>ID<49><44>map;
|
|||
|
|
|
|||
|
|
enum{ default_maxsize=10000 };
|
|||
|
|
|
|||
|
|
public:
|
|||
|
|
WHAllocationID(int nMaxSize = default_maxsize);
|
|||
|
|
~WHAllocationID(){};
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Size;
|
|||
|
|
void ReAllocate( int nMaxSize );
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID;
|
|||
|
|
int PopValue();
|
|||
|
|
//<2F>黹<EFBFBD><E9BBB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȥ<EFBFBD><C8A5>ID;
|
|||
|
|
void PushValue( int nID );
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
#endif
|