#pragma once
#include "DataType.h"
#include <queue>
#include "AxMutex.h"
class CThreadBase
{
public:
	CThreadBase();
	virtual ~CThreadBase();
	virtual void pushMsg(CInterProtocl *pdu);
public:
	BOOL start();
	BOOL end();
	BOOL m_bExit;
	HANDLE m_hEvent;
	HANDLE m_hThread;
	std::deque<CInterProtocl *> m_pduQueue;
	CAxMutex m_queMutex;
private:
	static unsigned int _stdcall HeartBeat(void *pParam);
	virtual void HeartBeat_Imp() = 0;
	virtual void DealOneRequestMsg(CInterProtocl *pITP) = 0;
	virtual void DealOneResponseMsg(CInterProtocl *pITP) = 0;
	//void DealOneRequestMsg(CInterProtocl &pdu) = 0;
	//void DealOneResponseMsg(CInterProtocl &pdu) = 0;
};