00001 #ifndef _ots_WorkLoop_h
00002 #define _ots_WorkLoop_h
00003
00004 #include <toolbox/task/WorkLoop.h>
00005 #include <string>
00006 #include "toolbox/lang/Class.h"
00007
00008 namespace ots
00009 {
00010 class WorkLoop : public virtual toolbox::lang::Class
00011 {
00012 public:
00013 WorkLoop(const std::string& name);
00014 virtual ~WorkLoop(void);
00015
00016 void startWorkLoop(void);
00017 bool stopWorkLoop(void);
00018 bool isActive(void) const;
00019
00020 protected:
00021 volatile bool continueWorkLoop_;
00022
00023 virtual bool workLoopThread(toolbox::task::WorkLoop* workLoop) = 0;
00024
00025
00026 const std::string& getWorkLoopName(void) const { return workLoopName_; }
00027
00028 private:
00029 const std::string workLoopName_;
00030 const std::string workLoopType_;
00031 toolbox::task::WorkLoop* workLoop_;
00032 toolbox::task::ActionSignature* job_;
00033 };
00034
00035 }
00036
00037 #endif