继承ligjingle写的第1个程序
来源:互联网 发布:软件测试精品课程网站 编辑:程序博客网 时间:2024/05/01 19:58
#include <string>
#include <iostream>
#include "talk/base/thread.h"
#include "talk/base/messagequeue.h"
using namespace cricket;
class HelpData : public MessageData
{
public: std::string info_;
};
class Police : public MessageHandler
{
public:
enum { MSG_HELP};
void Help(const std::string& info)
{
HelpData* data = new HelpData;
data->info_ = info;
Thread::Current()->Post(this, MSG_HELP, data);
}
virtual void OnMessage(Message* msg)
{
switch (msg->message_id)
{
case MSG_HELP:
HelpData* data = (HelpData*)msg->pdata;
std::cout << "MSG_HELP : " << data->info_ << std::endl;
break;
}
}
};
int main(int argc, char** argv)
{
Police p;
p.Help("Please help me!");
Thread::Current()->Start();
int d;
scanf("%d",&d);
return 0;
}
#include <iostream>
#include "talk/base/thread.h"
#include "talk/base/messagequeue.h"
using namespace cricket;
class HelpData : public MessageData
{
public: std::string info_;
};
class Police : public MessageHandler
{
public:
enum { MSG_HELP};
void Help(const std::string& info)
{
HelpData* data = new HelpData;
data->info_ = info;
Thread::Current()->Post(this, MSG_HELP, data);
}
virtual void OnMessage(Message* msg)
{
switch (msg->message_id)
{
case MSG_HELP:
HelpData* data = (HelpData*)msg->pdata;
std::cout << "MSG_HELP : " << data->info_ << std::endl;
break;
}
}
};
int main(int argc, char** argv)
{
Police p;
p.Help("Please help me!");
Thread::Current()->Start();
int d;
scanf("%d",&d);
return 0;
}
0 0
- 继承ligjingle写的第1个程序
- 第44个python程序:类的继承(显示覆写)
- 第44个python程序:类的继承(隐式)
- 第44个python程序:类的继承(在运行前和后覆写)
- 今天我流泪了,也是我进公司写的第500个程序。
- 第 1 个 STL 程序
- 第1个CUDA程序
- 第三个程序:继承
- 用Ogre写的第一个程序
- 写的第一个java程序。
- 我写的第一个程序 ~~~~~~~~
- 写个简单的生成奇阶幻方程序!
- 本人写的第一个 brainfuck 程序
- 无聊写了个看电影的程序,
- 我写的第一个ARM程序
- 写了个挺好玩的程序
- 写个OpenCV的小程序
- VS2013写QT的第一个程序
- 改变随机数中一些值的概率
- 打电话给大学同学苏喆
- 索引中include的魅力
- ABAP加锁解锁处理过程、标准函数ENQUEUE_ESFUNCTION
- 泛型
- 继承ligjingle写的第1个程序
- 我们上一次见是去年毕业十年聚会
- poj 1276:Cash Machine
- poj 2689——Prime Distance
- Maven中的DependencyManagement和Dependencies
- js Map实现
- 扩展欧几里得的几个定理以及证明
- 移植U-Boot过程中遇到的问题
- 【树状数组】 HDOJ 1541 Stars