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 // $Id: CmsShowTaskExecutorBase.cc,v 1.6 2009/01/23 21:35:42 amraktad Exp $
12 //
13 
14 // system include files
15 #include <iostream>
16 #include <TTimer.h>
17 
18 // user include files
21 
22 //
23 // constants, enums and typedefs
24 //
25 
26 //
27 // static data member definitions
28 //
29 
30 //
31 // constructors and destructor
32 //
34 //:m_timer( new TTimer(1) )
35 {
36  //m_timer->Connect("Timeout()","CmsShowTaskExecutorBase",this,"doNextTask()");
37  m_taskTimer = new CmsShowTaskTimer(this, 10);
38 }
39 
40 // CmsShowTaskExecutorBase::CmsShowTaskExecutorBase(const CmsShowTaskExecutorBase& rhs)
41 // {
42 // // do actual copying here;
43 // }
44 
46 {
47  //delete m_timer;
48 }
49 
50 //
51 // assignment operators
52 //
53 // const CmsShowTaskExecutorBase& CmsShowTaskExecutorBase::operator=(const CmsShowTaskExecutorBase& rhs)
54 // {
55 // //An exception safe implementation is
56 // CmsShowTaskExecutorBase temp(rhs);
57 // swap(rhs);
58 //
59 // return *this;
60 // }
61 
62 //
63 // member functions
64 //
65 void
67 {
68  //NOTE: If I use my own timer then the first time I call Start it works but the second
69  // time causes a segmentation fault
70 
71  //Emit("requestNextTask()");
72  //m_timer->Start(1,kTRUE);
73  //std::cout <<"requestNextTask"<<std::endl;
74  m_taskTimer->TurnOn();
75 }
76 
77 void
79 {
80  m_taskTimer->TurnOff();
81  doNextTaskImp();
82  if(moreTasksAvailable()) {
84  }
85  else {
86  tasksCompleted_.emit();
87  }
88 }
89 
90 //
91 // const member functions
92 //
93 
94 //
95 // static member functions
96 //
virtual bool moreTasksAvailable()=0
virtual void doNextTaskImp()=0
sigc::signal< void > tasksCompleted_