📄 indexalloctor.h
字号:
#ifndef _MINDEXALLOCTOR_ZHY_H
#define _MINDEXALLOCTOR_ZHY_H
#include "../Synchronization/Lock.h"
using namespace Synchronization;
#include <vector>
using namespace std;
class IndexAlloctor
{
public:
IndexAlloctor(int nTotalSize = 1000);
int AllocIndex();
void DeAllocIndex(int nIndex);
private:
inline int GetFreeIndex();
int m_nTotalSize;
int m_nFree;
int m_nFreeCount;
int m_bLockAll;
vector<int> m_vIndex;
CCriSection m_CriLock; // 访问任务队列时互斥
IndexAlloctor(const IndexAlloctor&);
IndexAlloctor& operator= (const IndexAlloctor&);
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -