otsdaq  v2_05_02_indev
WorkLoop.h
1 #ifndef _ots_WorkLoop_h
2 #define _ots_WorkLoop_h
3 
4 #include <toolbox/task/WorkLoop.h>
5 #include <string>
6 #include "toolbox/lang/Class.h"
7 
8 namespace ots
9 {
10 class WorkLoop : public virtual toolbox::lang::Class
11 {
12  public:
13  WorkLoop(const std::string& name);
14  virtual ~WorkLoop(void);
15 
16  void startWorkLoop(void);
17  bool stopWorkLoop(void);
18  bool isActive(void) const;
19 
20  protected:
21  volatile bool continueWorkLoop_;
22 
23  virtual bool workLoopThread(toolbox::task::WorkLoop* workLoop) = 0;
24 
25  // Getters
26  const std::string& getWorkLoopName(void) const { return workLoopName_; }
27 
28  private:
29  const std::string workLoopName_;
30  const std::string workLoopType_;
31  toolbox::task::WorkLoop* workLoop_;
32  toolbox::task::ActionSignature* job_;
33 };
34 
35 } // namespace ots
36 
37 #endif