BaseTask.h 652 B

1234567891011121314151617181920212223242526272829
  1. //
  2. // BaseTaskQueue.h
  3. // LibDriveRating-CXX
  4. //
  5. // Created by Melo Yao on 6/9/14.
  6. // Copyright (c) 2014 AutoNavi. All rights reserved.
  7. //
  8. #ifndef __LibDriveRating_CXX__BaseTaskQueue__
  9. #define __LibDriveRating_CXX__BaseTaskQueue__
  10. #include "TQInterface.h"
  11. namespace tq
  12. {
  13. class BaseTask : public ITask
  14. {
  15. private:
  16. volatile bool _cancelled;
  17. public:
  18. BaseTask();
  19. void Run();
  20. virtual void Cancel();
  21. bool IsCancelled() const;
  22. virtual void Main() = 0;
  23. TaskCategory GetCategory() const {return NoCategory;}
  24. };
  25. }
  26. #endif /* defined(__LibDriveRating_CXX__BaseTaskQueue__) */