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
Go4TaskHandlerExample
TGo4MainRunnable.cxx
Go to the documentation of this file.
1
// $Id: TGo4MainRunnable.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 "
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*) constructor"
,__LINE__, __FILE__));
27
fxApplication
=cli->
GetApplication
();
28
}
29
30
TGo4MainRunnable::~TGo4MainRunnable
()
31
{
32
GO4TRACE
((15,
"TGo4MainRunnable::~TGo4MainRunnable() destructor"
,__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
TGo4Command
* com=0;
40
TGo4ExampleClient
* cli=
dynamic_cast<
TGo4ExampleClient
*
>
(
fxManager
);
41
if
(!cli)
42
throw
TGo4LogicException
();
43
com=cli->
NextCommand
();
44
if
(com!=0)
45
{
46
TGo4LockGuard
mainlock;
// protect command invocation!
47
TGo4CommandInvoker::Instance
()->
Invoke
(com);
// execute command by invoker
48
delete
com;
49
}
50
else
51
{ }
52
// do "main event loop"...
53
fxApplication
->
FillHistograms
();
54
TGo4Thread::Sleep
(20);
55
return
0;
56
}
TGo4ExampleClient
Definition:
TGo4ExampleClient.h:29
TGo4LockGuard
Definition:
TGo4LockGuard.h:40
TGo4Runnable::fxManager
TGo4ThreadManager * fxManager
Definition:
TGo4Runnable.h:71
TGo4MainRunnable::fxApplication
TGo4ExampleApplication * fxApplication
Definition:
TGo4MainRunnable.h:41
TGo4Task::NextCommand
virtual TGo4Command * NextCommand()
Definition:
TGo4Task.cxx:357
TGo4Thread::Sleep
static void Sleep(UInt_t millisecs)
Definition:
TGo4Thread.cxx:336
TGo4MainRunnable::TGo4MainRunnable
TGo4MainRunnable()
TGo4CommandInvoker.h
TGo4Log.h
TGo4MainRunnable::Run
virtual Int_t Run(void *)
Definition:
TGo4MainRunnable.cxx:35
TGo4CommandInvoker::Instance
static TGo4CommandInvoker * Instance()
Definition:
TGo4CommandInvoker.cxx:74
TGo4Thread.h
TGo4Runnable
Definition:
TGo4Runnable.h:33
TGo4ExampleApplication::FillHistograms
void FillHistograms()
Definition:
TGo4ExampleApplication.cxx:61
TGo4CommandInvoker::Invoke
virtual void Invoke(TGo4Command *com)
Definition:
TGo4CommandInvoker.cxx:121
TGo4Command
Definition:
TGo4Command.h:36
TGo4MainRunnable::~TGo4MainRunnable
virtual ~TGo4MainRunnable()
Definition:
TGo4MainRunnable.cxx:30
TGo4LogicException
Definition:
TGo4LogicException.h:19
GO4TRACE
#define GO4TRACE(X)
Definition:
TGo4Log.h:26
TGo4ExampleClient::GetApplication
TGo4ExampleApplication * GetApplication()
Definition:
TGo4ExampleClient.cxx:92
TGo4MainRunnable.h
TGo4LogicException.h
Generated on Fri Oct 26 2018 08:34:53 for GSI Object Oriented Online Offline (Go4) by
1.8.8