#include "stdafx.h"
#include "DataCenter.h"

CDataCenter *CDataCenter::m_pDataCenter = NULL;
CDataCenter::CDataCenter()
{

}

CDataCenter::~CDataCenter()
{
	UnInstance();
}

CDataCenter * CDataCenter::GetInstance()
{
	if (m_pDataCenter == NULL)
	{
		m_pDataCenter = new CDataCenter;
	}
	return m_pDataCenter;
}

void CDataCenter::UnInstance()
{
	delete m_pDataCenter;
	m_pDataCenter = NULL;
}

CInterProtocl * CDataCenter::GetITP()
{
	return m_pool->GetIdleITP();
}

void CDataCenter::setResponseITP( CInterProtocl *pReq, CInterProtocl *pRes )
{
	pRes->m_eventType = EVENT_RESPONSE;
	pRes->m_srcModule = pReq->m_desModule;
	pRes->m_desModule = pReq->m_srcModule;
	pRes->m_operation = pReq->m_operation;
	//pRes->m_nParam1 = pReq->m_nParam1;
	//pRes->m_nParam2 = pReq->m_nParam2;
	//pRes->m_nParam3 = pReq->m_nParam3;
}

int CDataCenter::getIdleCount()
{
	return m_pool->getIdleCount();
}