msglist.cpp

来自「电梯仿真系统的实现」· C++ 代码 · 共 45 行

CPP
45
字号
// 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;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?