CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CmsShowTaskExecutorBase.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Core
4 // Class : CmsShowTaskExecutorBase
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Chris Jones
10 // Created: Fri Jul 11 12:09:41 EDT 2008
11 //
12 
13 // system include files
14 #include <iostream>
15 #include <TTimer.h>
16 
17 // user include files
20 
21 //
22 // constants, enums and typedefs
23 //
24 
25 //
26 // static data member definitions
27 //
28 
29 //
30 // constructors and destructor
31 //
33 //:m_timer( new TTimer(1) )
34 {
35  //m_timer->Connect("Timeout()","CmsShowTaskExecutorBase",this,"doNextTask()");
36  m_taskTimer = new CmsShowTaskTimer(this, 10);
37 }
38 
39 // CmsShowTaskExecutorBase::CmsShowTaskExecutorBase(const CmsShowTaskExecutorBase& rhs)
40 // {
41 // // do actual copying here;
42 // }
43 
45 {
46  //delete m_timer;
47 }
48 
49 //
50 // assignment operators
51 //
52 // const CmsShowTaskExecutorBase& CmsShowTaskExecutorBase::operator=(const CmsShowTaskExecutorBase& rhs)
53 // {
54 // //An exception safe implementation is
55 // CmsShowTaskExecutorBase temp(rhs);
56 // swap(rhs);
57 //
58 // return *this;
59 // }
60 
61 //
62 // member functions
63 //
64 void
66 {
67  //NOTE: If I use my own timer then the first time I call Start it works but the second
68  // time causes a segmentation fault
69 
70  //Emit("requestNextTask()");
71  //m_timer->Start(1,kTRUE);
72  //std::cout <<"requestNextTask"<<std::endl;
73  m_taskTimer->TurnOn();
74 }
75 
76 void
78 {
79  m_taskTimer->TurnOff();
80  doNextTaskImp();
81  if(moreTasksAvailable()) {
83  }
84  else {
85  tasksCompleted_.emit();
86  }
87 }
88 
89 //
90 // const member functions
91 //
92 
93 //
94 // static member functions
95 //
virtual bool moreTasksAvailable()=0
virtual void doNextTaskImp()=0
sigc::signal< void > tasksCompleted_