-
Notifications
You must be signed in to change notification settings - Fork 0
/
thread_msg.h
executable file
·94 lines (87 loc) · 1.72 KB
/
thread_msg.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#ifndef __THREAD_MSG_H__
#define __THREAD_MSG_H__
extern int go;
#include "xmlproc.h"
#include "HuMsg.h"
void ParaseUpdateXml3(TiXmlNode* pParent, xmlproc * xml);
int ParseXMLElement(HUMap & xmlmp);
void GetInfo(const char * name, info & info);
class msg_thread: public thread
{
public:
Msg msg;
//thread_debug tdbg;
int PostMsg(const char * str)
{
msg.send_message(100, str);
}
int run()
{
msg.init_message();
while (go)
{
hu_msgbuf qbuf;
msg.read_message(100, &qbuf);
TiXmlDocument xml;
xml.Parse(qbuf.mtext);
ParaseUpdateXml3(&xml, g_cur_xml);
}
printf("msg thread exit\r\n");
}
};
extern msg_thread g_th_msg;
//class ExeMsg
//{
// hustr snd;
// int cnt;
//public:
// operator const char *()
// {
// return snd.c_str();
// }
// ExeMsg()
// {
// cnt = 0;
// }
// int start()
// {
// if (cnt != 0)
// {
// printf("ExeMsg::start %s\r\n", snd.nstr());
// g_th_msg.PostMsg(snd);
// }
// return cnt;
// }
// void add(const char * key, const char * value)
// {
// //printf("ExeMsg add %s %s\r\n",key,value);
// snd += key;
// snd += "=\"";
// snd += value;
// snd += "\" ";
// cnt++;
// }
// void add(HUMap & mp, const char * str)
// {
// if (mp.exist(str))
// {
// add(str, mp[str].getvalue());
// }
// }
// void parase(HUMap & mp)
// {
// snd = "<control event=proc ";
//// HUMap::iterator it;
//// for (it = mp.begin(); it != mp.end(); ++it)
//// {
//// add(it->second.getkey(), it->second.getvalue());
//// }
// add(mp, "run");
// add(mp, "run_bg");
// add(mp, "jump");
// add(mp, "cs");
// snd += "/>";
// debug("executable::parase %s\r\n", snd.nstr());
// }
//};
#endif //__THREAD_MSG_H__