修改三方通话功能,在发起三方通话时,先保持住主叫,然后再拉回主叫到会议

MsgCenter.h 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*************************************************************************
  2. 【文件名】 MsgCenter.h
  3. 【功能模块和目的】 消息分派中心类头文件
  4. 【开发者及日期】 郑石诺 2015/01/04
  5. 【版本】 V1.0.0
  6. 【版权信息】 Copyright (C)2015 河南华谊网络科技有限公司
  7. 【更改记录】
  8. *************************************************************************/
  9. #pragma once
  10. #include <map>
  11. using namespace std;
  12. class IMsgObserver;
  13. /*************************************************************************
  14. 【类名】 CMsgCenter
  15. 【功能】 消息分派中心类
  16. 【接口说明】
  17. 【开发者及日期】 郑石诺 2015/01/04
  18. 【版本】 V1.0.0
  19. 【版权信息】 Copyright (C)2015 河南华谊网络科技有限公司
  20. 【更改记录】
  21. *************************************************************************/
  22. class CMsgCenter
  23. {
  24. SINGLETON_DECLARE(CMsgCenter)
  25. public:
  26. ~CMsgCenter(void);
  27. void startInThreadMode(void);
  28. void startMsgPump(void);
  29. void stopMsgPump(void);
  30. void regist(UINT MsgType, IMsgObserver* pObserver); // 订阅消息
  31. void unregist(UINT MsgType, IMsgObserver* pObserver); // 取消订阅
  32. void pushMsg(UINT MsgType, PARAM lpContent); // 设备消息变化通知接口
  33. private:
  34. CMsgCenter(void);
  35. void __wait(void); // 无消息时置线程于等待信号状态
  36. int __dispatchMsg(void); // 处理事件消息,线程函数调用
  37. void __sendMsgToObserver(UINT MsgType, PARAM lpContent); // 发送消息给订阅者
  38. void __releaseMsg(UINT MsgType, PARAM lpContent); // 释放消息内容
  39. static UINT __dipatchThreadFunc(LPVOID pParam); // 处理消息事件线程函数
  40. private:
  41. typedef struct
  42. {
  43. UINT MsgType; // 事件类型
  44. PARAM Content; // 事件内容
  45. } MSG_INNER;
  46. typedef multimap<UINT, IMsgObserver*> ObsvrMap;
  47. typedef CList<MSG_INNER*, MSG_INNER*> MsgList;
  48. volatile bool m_Stop;
  49. ObsvrMap m_ObsvrMap; // 消息订阅者存储结构
  50. MsgList m_MsgList; // 消息缓存队列
  51. CWinThread* m_pThreadObj; // 消息分发线程对象
  52. CCriticalSection m_RWLock; // 事件缓冲队列的互斥对象
  53. CEvent m_ThreadSleepFlag; // 消息分发线程睡眠的信号事件
  54. };