GSI Object Oriented Online Offline (Go4)
GO4-6.4.0
Loading...
Searching...
No Matches
Go4TaskHandlerExample
TGo4MainRunnable.cxx
Go to the documentation of this file.
1
// $Id$
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 fuer 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 "
TGo4MainRunnable.h
"
15
16
#include "
TGo4Log.h
"
17
#include "TGo4LockGuard.h"
18
#include "
TGo4Thread.h
"
19
20
#include "
TGo4CommandInvoker.h
"
21
#include "
TGo4LogicException.h
"
22
23
TGo4MainRunnable::TGo4MainRunnable
(
const
char
*name,
TGo4ExampleClient
* cli)
24
:
TGo4Runnable
(name,cli)
25
{
26
GO4TRACE
((15,
"TGo4MainRunnable::TGo4MainRunnable(const char *,TGo4ExampleClient *)"
,__LINE__, __FILE__));
27
fxApplication
=cli->
GetApplication
();
28
}
29
30
TGo4MainRunnable::~TGo4MainRunnable
()
31
{
32
GO4TRACE
((15,
"TGo4MainRunnable::~TGo4MainRunnable()"
,__LINE__, __FILE__));
33
}
34
35
Int_t
TGo4MainRunnable::Run
(
void
*)
36
{
37
GO4TRACE
((12,
"TGo4MainRunnable::Run()"
,__LINE__, __FILE__));
38
// first test: simply wait for command, then execute it and send back an object
39
TGo4ExampleClient
* cli=
dynamic_cast<
TGo4ExampleClient
*
>
(
fxManager
);
40
if
(!cli)
41
throw
TGo4LogicException
();
42
TGo4Command
*com = cli->
NextCommand
();
43
if
(com) {
44
TGo4LockGuard
mainlock;
// protect command invocation!
45
TGo4CommandInvoker::Instance
()->
Invoke
(com);
// execute command by invoker
46
delete
com;
47
}
48
// do "main event loop"...
49
fxApplication
->FillHistograms();
50
TGo4Thread::Sleep
(20);
51
return
0;
52
}
TGo4LockGuard
#define TGo4LockGuard
Definition
QRootCanvas.cpp:59
TGo4CommandInvoker.h
TGo4Log.h
GO4TRACE
#define GO4TRACE(X)
Definition
TGo4Log.h:25
TGo4LogicException.h
TGo4MainRunnable.h
TGo4Thread.h
TGo4CommandInvoker::Instance
static TGo4CommandInvoker * Instance()
Definition
TGo4CommandInvoker.cxx:69
TGo4CommandInvoker::Invoke
virtual void Invoke(TGo4Command *com)
Definition
TGo4CommandInvoker.cxx:113
TGo4Command
This is the Go4 Abstract Command Class; part of the Base command pattern.
Definition
TGo4Command.h:35
TGo4ExampleClient
Example class for a client application; this may be the analysis client later on which keeps the anal...
Definition
TGo4ExampleClient.h:29
TGo4ExampleClient::GetApplication
TGo4ExampleApplication * GetApplication()
Definition
TGo4ExampleClient.cxx:94
TGo4LogicException
Definition
TGo4LogicException.h:19
TGo4MainRunnable::~TGo4MainRunnable
virtual ~TGo4MainRunnable()
Definition
TGo4MainRunnable.cxx:30
TGo4MainRunnable::fxApplication
TGo4ExampleApplication * fxApplication
1
Definition
TGo4MainRunnable.h:41
TGo4MainRunnable::TGo4MainRunnable
TGo4MainRunnable()
TGo4MainRunnable::Run
Int_t Run(void *) override
The working function which runs in the thread.
Definition
TGo4MainRunnable.cxx:35
TGo4Runnable::TGo4Runnable
TGo4Runnable(const TGo4Runnable &right)
Definition
TGo4Runnable.cxx:24
TGo4Runnable::fxManager
TGo4ThreadManager * fxManager
The threadmanager which is responsible for our thread.
Definition
TGo4Runnable.h:72
TGo4Task::NextCommand
virtual TGo4Command * NextCommand()
Delivers next command from command queue.
Definition
TGo4Task.cxx:325
TGo4Thread::Sleep
static void Sleep(UInt_t millisecs)
wrapper for gSystem->Sleep with consecutive TThread::CancelPoint - necessary for proper pthread termi...
Definition
TGo4Thread.cxx:290
Generated by
1.13.2