惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
Last Week in AI
Last Week in AI
IT之家
IT之家
A
About on SuperTechFans
M
MIT News - Artificial intelligence
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
博客园 - 【当耐特】
V
Visual Studio Blog
Microsoft Security Blog
Microsoft Security Blog
博客园_首页
aimingoo的专栏
aimingoo的专栏
The Cloudflare Blog
Vercel News
Vercel News
博客园 - Franky
有赞技术团队
有赞技术团队
B
Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
GbyAI
GbyAI
量子位
云风的 BLOG
云风的 BLOG
T
Tailwind CSS Blog

博客园 - Jacken

ios basics 关于 php mvc 转: Basic JavaScript Part 8: Namespaces Simple JavaScript Inheritance javascript 命名空间 继承 实现 转: CSS网页布局教程:绝对定位和相对定位 js 类与对象 div 垂直居中 布局 boost signal 用法与用处... Flash嵌入纯Win32程序 及 事件接收 工若善其器,必然利其事。 HTML5开发工具选择 项目 "差不多成功? 简直就是失败". html css 布局 ubuntu 使用 wifi 连接上网 用背景图片填充Edit控件... 游戏类初步一.. C++的异常处理方法之一. - Jacken - 博客园 C++ EventHandler v0.02 在命令行中使用cl工具生成纯资源的DLL文件...
消息发送器设计
Jacken · 2011-09-18 · via 博客园 - Jacken

class CEventDispatcher

{

public:

bool  AddEventListener(int nEventID, CEventListener* pListener);

bool  RemoveEventListener(int nEventID, CEventListener* pListener);

bool  DispatchEvent(int nEventID, int nEventType, string& strXmlData)

{

 for (iterListener; iterListener != m_listListeners.end(); iterListener++)

{

//如果ID相等并且m_listRemoved里没有该listener, 则派发事件

protected:

 std::map<int,CEventListener*>  m_listListeners;

std::map<int,CEventListener*>  m_listRemoved; 

};