#include "stdafx.h" #include "IndexAlloc.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif CIndexAlloc::CIndexAlloc() { m_lpIndexs = NULL; m_nIndexNum = 0; } CIndexAlloc::~CIndexAlloc() { if(m_lpIndexs) delete [] m_lpIndexs; m_lpIndexs = NULL; } /************************************************************************/ /* 函数:Initialize 描述:初始化 参数: IN CONST DWORD dwMaxNum 最大索引个数 返回:TRUE=成功,FALSE=失败 */ /************************************************************************/ BOOL CIndexAlloc::Initialize(IN CONST int dwMaxNum) { if(dwMaxNum <= 0) return FALSE; m_nIndexNum = dwMaxNum; m_lpIndexs = new SINDEX[dwMaxNum]; for(int i = 0; i