GSI Object Oriented Online Offline (Go4)
GO4-5.3.2
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Go4ThreadManagerExample
TGo4TestThreadManager.cxx
Go to the documentation of this file.
1
// $Id: TGo4TestThreadManager.cxx 999 2013-07-25 11:58:59Z linev $
2
//-----------------------------------------------------------------------
3
// The GSI Online Offline Object Oriented (Go4) Project
4
// Experiment Data Processing at EE department, GSI
5
//-----------------------------------------------------------------------
6
// Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
7
// Planckstr. 1, 64291 Darmstadt, Germany
8
// Contact: http://go4.gsi.de
9
//-----------------------------------------------------------------------
10
// This software can be used under the license agreements as stated
11
// in Go4License.txt file which is part of the distribution.
12
//-----------------------------------------------------------------------
13
14
#include "
TGo4TestThreadManager.h
"
15
16
#include "
TGo4Log.h
"
17
#include "
TGo4ThreadHandler.h
"
18
#include "
TGo4TestRunnable.h
"
19
20
TGo4TestThreadManager::TGo4TestThreadManager
(
const
TGo4TestThreadManager
&right)
21
:
TGo4ThreadManager
(right)
22
{
23
GO4TRACE
((15,
"TGo4TestThreadManager::TGo4TestThreadManager copy ctor"
,__LINE__, __FILE__));
24
}
25
26
TGo4TestThreadManager::TGo4TestThreadManager
(
const
char
* name)
27
:
TGo4ThreadManager
(name,kFALSE)
28
{
29
GO4TRACE
((15,
"TGo4TestThreadManager::TGo4TestThreadManager (const char* name) constructor"
,__LINE__, __FILE__));
30
fxControlRunnable
=
new
TGo4TestRunnable
(
"ControlRunnable"
,
this
,1);
31
TGo4TestRunnable
* th1run=
new
TGo4TestRunnable
(
"HistogramMaker1"
,
this
,4);
32
TGo4TestRunnable
* th2run=
new
TGo4TestRunnable
(
"HistogramMaker2"
,
this
,4);
33
//TGo4TestRunnable* th3run= new TGo4TestRunnable("dummy action 3",this,0);
34
TGo4TestRunnable
* th4run=
new
TGo4TestRunnable
(
"Exceptiontester"
,
this
,6);
35
TGo4TestRunnable
* th5run=
new
TGo4TestRunnable
(
"Service thread"
,
this
,0);
36
37
fxWorkHandler
->
NewThread
(
"First Thread"
,th1run);
38
fxWorkHandler
->
NewThread
(
"Second Thread"
,th2run);
39
fxWorkHandler
->
NewThread
(
"Third Thread"
,th5run);
40
fxWorkHandler
->
NewThread
(
"Fourth Thread"
,th4run);
41
fxWorkHandler
->
NewThread
(
"Control"
,
fxControlRunnable
);
42
TGo4Log::Info
(
"thread manager: all threads added to handler"
);
43
44
fxCanvas
=
new
TCanvas(GetName(),
"TestRunnable"
,1200,400);
45
fxPad1
=
new
TPad(
"Pad1"
,
"TestRunnablePad"
,0.02,0.02,0.48,0.83,33);
46
fxPad2
=
new
TPad(
"Pad2"
,
"TestRunnablePad"
,0.52,0.02,0.98,0.83,33);
47
fxCanvas
->cd();
48
TGo4Log::Info
(
"canvas drawn"
);
49
fxPad1
->Draw();
50
fxCanvas
->cd();
51
fxPad2
->Draw();
52
TGo4Log::Info
(
"pads drawn"
);
53
fxCanvas
->Modified();
54
fxCanvas
->Update();
55
56
Launch
();
57
}
58
59
TGo4TestThreadManager::~TGo4TestThreadManager
()
60
{
61
GO4TRACE
((15,
"TGo4TestThreadManager::~TGo4TestThreadManager destructor"
,__LINE__, __FILE__));
62
delete
fxPad1
;
63
delete
fxPad2
;
64
delete
fxCanvas
;
65
}
66
67
Int_t
TGo4TestThreadManager::TestAction
()
68
{
69
GO4TRACE
((14,
"TGo4TestThreadManager::TestAction"
,__LINE__, __FILE__));
70
// no test action so far...
71
return
0;
72
}
73
74
TCanvas*
TGo4TestThreadManager::GetCanvas
()
75
{
76
GO4TRACE
((12,
"TGo4TestThreadManager::GetCanvas"
,__LINE__, __FILE__));
77
return
fxCanvas
;
78
}
79
80
TPad*
TGo4TestThreadManager::GetPad1
()
81
{
82
GO4TRACE
((12,
"TGo4TestThreadManager::GetPad1"
,__LINE__, __FILE__));
83
return
fxPad1
;
84
}
85
86
TPad*
TGo4TestThreadManager::GetPad2
()
87
{
88
GO4TRACE
((12,
"TGo4TestThreadManager::GetPad2"
,__LINE__, __FILE__));
89
return
fxPad2
;
90
}
TGo4TestRunnable
Definition:
TGo4TestRunnable.h:67
TGo4TestThreadManager::fxCanvas
TCanvas * fxCanvas
Definition:
TGo4TestThreadManager.h:66
TGo4TestThreadManager::GetCanvas
TCanvas * GetCanvas()
Definition:
TGo4TestThreadManager.cxx:74
TGo4TestThreadManager::GetPad1
TPad * GetPad1()
Definition:
TGo4TestThreadManager.cxx:80
TGo4ThreadManager
Definition:
TGo4ThreadManager.h:30
TGo4TestThreadManager::TestAction
virtual Int_t TestAction()
Definition:
TGo4TestThreadManager.cxx:67
TGo4ThreadManager::fxWorkHandler
TGo4ThreadHandler * fxWorkHandler
Definition:
TGo4ThreadManager.h:142
TGo4TestThreadManager::fxPad1
TPad * fxPad1
Definition:
TGo4TestThreadManager.h:67
TGo4TestRunnable.h
TGo4ThreadHandler.h
TGo4ThreadHandler::NewThread
Bool_t NewThread(const char *name, TGo4Runnable *runnable)
Definition:
TGo4ThreadHandler.cxx:149
TGo4TestThreadManager::fxControlRunnable
TGo4TestRunnable * fxControlRunnable
Definition:
TGo4TestThreadManager.h:60
TGo4Log.h
TGo4TestThreadManager.h
TGo4TestThreadManager
Definition:
TGo4TestThreadManager.h:33
TGo4TestThreadManager::fxPad2
TPad * fxPad2
Definition:
TGo4TestThreadManager.h:68
TGo4TestThreadManager::~TGo4TestThreadManager
virtual ~TGo4TestThreadManager()
Definition:
TGo4TestThreadManager.cxx:59
TGo4TestThreadManager::GetPad2
TPad * GetPad2()
Definition:
TGo4TestThreadManager.cxx:86
GO4TRACE
#define GO4TRACE(X)
Definition:
TGo4Log.h:26
TGo4ThreadManager::Launch
void Launch()
Definition:
TGo4ThreadManager.cxx:215
TGo4Log::Info
static void Info(const char *text,...)
Definition:
TGo4Log.cxx:283
TGo4TestThreadManager::TGo4TestThreadManager
TGo4TestThreadManager()
Generated on Fri Oct 26 2018 08:34:53 for GSI Object Oriented Online Offline (Go4) by
1.8.8