forked from p308945/MyNetWorkLib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyClientTaskManager.h
More file actions
42 lines (38 loc) · 1.04 KB
/
MyClientTaskManager.h
File metadata and controls
42 lines (38 loc) · 1.04 KB
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
/*************************************************************************
> File Name: MyClientTaskManager.h
> Author: huangyun
> Mail: 895175589@qq.com
> Created Time: Sun 09 Aug 2015 12:58:02 AM
************************************************************************/
#ifndef __MY_CLIENT_TASK_MANAGER_H_
#define __MY_CLIENT_TASK_MANAGER_H_
#include "../base/MySingleton.h"
#include "../base/MyLock.h"
#include "MySockClientTask.h"
#include <map>
namespace MyNameSpace
{
class MyClientTaskManager : public MySingleton<MyClientTaskManager>
{
private:
friend class MySingleton<MyClientTaskManager>;
MyClientTaskManager()
{
}
~MyClientTaskManager()
{
}
public:
void addTask(MySockClientTask *task);
void removeTask(MySockClientTask *task);
bool doProcessMsg();
void testSend();
MySockClientTask *getTaskById(int);
private:
typedef std::map<int, MySockClientTask*> Container;
typedef std::map<int, MySockClientTask*>::iterator Container_IT;
Container mTasks;
MyLock mLock;
};
}
#endif