DriverThread.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #pragma once
  2. // 下列 ifdef 块是创建使从 DLL 导出更简单的
  3. // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 DRIVERTHREAD_EXPORTS
  4. // 符号编译的。在使用此 DLL 的
  5. // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
  6. // DRIVERTHREAD_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
  7. // 符号视为是被导出的。
  8. #include "MsgMap.h"
  9. #include "MsgVector.h"
  10. #include "CcosThread.h"
  11. #include "LogicDevice.h"
  12. class Driver_Thread : public Work_Thread
  13. {
  14. protected:
  15. bool HandleClientRequest();
  16. bool HandleDeviceNotify();
  17. MsgMap<UINT64, LogicDeviceSysIF*> *m_pDeviceSysIFMap;
  18. MsgVector<LogicDeviceSysIF*> *m_pDeviceSysIFVec;
  19. virtual bool Exec();
  20. virtual bool OnEndThread();
  21. virtual bool OnStartThread();
  22. public:
  23. Driver_Thread(void);
  24. virtual ~Driver_Thread(void);
  25. //work
  26. //IF
  27. void RegistSysIFObject(LogicDeviceSysIF* pobj);
  28. bool UnRegistSysIFObject(LogicDeviceSysIF* pobj);
  29. };
  30. class Notify_Driver_Thread : public Driver_Thread
  31. {
  32. public:
  33. Notify_Driver_Thread(void);
  34. virtual ~Notify_Driver_Thread(void);
  35. protected:
  36. int WaitForEvent();//Req,NotifyPacket,NotifyEvt
  37. virtual bool Exec();
  38. bool ProcessDeviceEvent(size_t Idx);
  39. };
  40. //class Dual_Driver_Thread
  41. //{
  42. // Driver_Thread *m_pReqThread;
  43. // Driver_Thread *m_pResThread;
  44. //public:
  45. // Dual_Driver_Thread(void);
  46. // virtual ~Dual_Driver_Thread(void);
  47. //
  48. // //IF
  49. // void InitDriverThread(Driver_Thread *pReq, Driver_Thread *pRes);
  50. // bool HasThread(DWORD Tid);
  51. // bool StartThread(bool Sync = true, bool Inherit = true);
  52. // bool StopThread(DWORD timeperiod = 10000);
  53. //
  54. // bool PushReqDataObject(ResDataObject &obj);
  55. // bool PushResDataObject(ResDataObject &obj);
  56. //
  57. // void RegistSysIFObject(LogicDeviceSysIF* pobj);
  58. // bool UnRegistSysIFObject(LogicDeviceSysIF* pobj);
  59. //
  60. // void SetLogger(PVOID pLogger);
  61. //
  62. // Work_Thread* GetReqThread() { return m_pReqThread; }
  63. // Work_Thread* GetResThread() { return m_pResThread; }
  64. //
  65. //};