www.pudn.com > Elevators.rar > MsgList.cpp


// MsgList.cpp: implementation of the CMsgList class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#include "stdafx.h" 
#include "ESystem.h" 
#include "MsgList.h" 
 
#ifdef _DEBUG 
#undef THIS_FILE 
static char THIS_FILE[]=__FILE__; 
#define new DEBUG_NEW 
#endif 
 
////////////////////////////////////////////////////////////////////// 
// Construction/Destruction 
////////////////////////////////////////////////////////////////////// 
 
CMsgList::CMsgList() 
{ 
 
} 
 
CMsgList::~CMsgList() 
{ 
 
} 
 
bool CMsgList::RemoveByPID(int pid) 
{ 
	CMsgList::iterator it; 
	CMessage* tmp; 
	for(it = begin();it!=end();it++) 
	{ 
		tmp = *it; 
		if(tmp->PID == pid) 
		{ 
			remove(tmp); 
			return true; 
		} 
	} 
	TRACE("消息队列中没有该乘客P%d,指令有误.\n",pid); 
	return false; 
}