The Gaudi Framework
v26r1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
HelloWorld.cpp
Go to the documentation of this file.
1
// Include files
2
#include "GaudiKernel/MsgStream.h"
3
#include "GaudiKernel/DataObject.h"
4
#include "GaudiKernel/IDataProviderSvc.h"
5
#include "
HelloWorld.h
"
6
7
// Static Factory declaration
8
DECLARE_COMPONENT
(
HelloWorld
)
9
10
// Constructor
11
//------------------------------------------------------------------------------
12
HelloWorld
::
HelloWorld
(const
std
::
string
& name,
ISvcLocator
* ploc)
13
:
Algorithm
(name, ploc) {
14
//------------------------------------------------------------------------------
15
m_initialized =
false
;
16
}
17
18
//------------------------------------------------------------------------------
19
StatusCode
HelloWorld::initialize
() {
20
//------------------------------------------------------------------------------
21
// avoid calling initialize more than once
22
if
(
m_initialized
)
return
StatusCode::SUCCESS
;
23
24
MsgStream
log
(
msgSvc
(),
name
());
25
log <<
MSG::INFO
<<
"initializing...."
<<
endmsg
;
26
27
m_initialized
=
true
;
28
return
StatusCode::SUCCESS
;
29
}
30
31
32
//------------------------------------------------------------------------------
33
StatusCode
HelloWorld::execute
() {
34
//------------------------------------------------------------------------------
35
MsgStream
log
(
msgSvc
(),
name
() );
36
log <<
MSG::INFO
<<
"executing...."
<<
endmsg
;
37
38
return
StatusCode::SUCCESS
;
39
}
40
41
42
//------------------------------------------------------------------------------
43
StatusCode
HelloWorld::finalize
() {
44
//------------------------------------------------------------------------------
45
MsgStream
log
(
msgSvc
(),
name
());
46
log <<
MSG::INFO
<<
"finalizing...."
<<
endmsg
;
47
48
m_initialized
=
false
;
49
return
StatusCode::SUCCESS
;
50
}
51
//------------------------------------------------------------------------------
52
StatusCode
HelloWorld::beginRun
() {
53
//------------------------------------------------------------------------------
54
MsgStream
log
(
msgSvc
(),
name
());
55
log <<
MSG::INFO
<<
"beginning new run...."
<<
endmsg
;
56
57
m_initialized
=
true
;
58
return
StatusCode::SUCCESS
;
59
}
60
61
62
//------------------------------------------------------------------------------
63
StatusCode
HelloWorld::endRun
() {
64
//------------------------------------------------------------------------------
65
MsgStream
log
(
msgSvc
(),
name
());
66
log <<
MSG::INFO
<<
"ending new run...."
<<
endmsg
;
67
68
m_initialized
=
true
;
69
return
StatusCode::SUCCESS
;
70
}
GaudiPython
src
Test
HelloWorld.cpp
Generated on Mon Feb 16 2015 11:56:57 for The Gaudi Framework by
1.8.2