TestWorker.h 428 B

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #include "scan_common.h"
  3. class CBaseTask{
  4. public:
  5. virtual void run(){}
  6. };
  7. class CTestWorker:public IService
  8. {
  9. public:
  10. CTestWorker(void);
  11. ~CTestWorker(void);
  12. bool isBusy(){
  13. return m_isBusy;
  14. }
  15. void addTask(CBaseTask * task){
  16. m_task =task;
  17. m_isBusy =true;
  18. }
  19. protected:
  20. virtual ServiceState OnRunning( void );
  21. virtual ServiceState OnStarting( void );
  22. private:
  23. bool m_isBusy;
  24. CBaseTask * m_task;
  25. };