CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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  //delete m_timer;
46 }
47 
48 //
49 // assignment operators
50 //
51 // const CmsShowTaskExecutorBase& CmsShowTaskExecutorBase::operator=(const CmsShowTaskExecutorBase& rhs)
52 // {
53 // //An exception safe implementation is
54 // CmsShowTaskExecutorBase temp(rhs);
55 // swap(rhs);
56 //
57 // return *this;
58 // }
59 
60 //
61 // member functions
62 //
64  //NOTE: If I use my own timer then the first time I call Start it works but the second
65  // time causes a segmentation fault
66 
67  //Emit("requestNextTask()");
68  //m_timer->Start(1,kTRUE);
69  //std::cout <<"requestNextTask"<<std::endl;
70  m_taskTimer->TurnOn();
71 }
72 
74  m_taskTimer->TurnOff();
75  doNextTaskImp();
76  if (moreTasksAvailable()) {
78  } else {
79  tasksCompleted_.emit();
80  }
81 }
82 
83 //
84 // const member functions
85 //
86 
87 //
88 // static member functions
89 //
virtual bool moreTasksAvailable()=0
virtual void doNextTaskImp()=0
sigc::signal< void > tasksCompleted_