CGEM BOSS
6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
HelloWorld.cxx
Go to the documentation of this file.
1
#include "
ExHelloWorld/HelloWorld.h
"
2
#include "GaudiKernel/MsgStream.h"
3
4
/////////////////////////////////////////////////////////////////////////////
5
6
HelloWorld::HelloWorld
(
const
std::string& name, ISvcLocator* pSvcLocator) :
7
Algorithm(name, pSvcLocator), m_myInt(0), m_myBool(0), m_myDouble(0)
8
{
9
// Part 1: Declare the properties
10
declareProperty(
"MyInt"
, m_myInt);
11
declareProperty(
"MyBool"
, m_myBool);
12
declareProperty(
"MyDouble"
, m_myDouble);
13
declareProperty(
"MyStringVec"
,m_myStringVec);
14
}
15
16
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
17
18
StatusCode
HelloWorld::initialize
(){
19
20
// Part 1: Get the messaging service, print where you are
21
MsgStream log(
msgSvc
(), name());
22
log << MSG::INFO <<
" HelloWorld initialize()"
<< endreq;
23
24
// Part 2: Print out the property values
25
log << MSG::INFO <<
" MyInt = "
<< m_myInt << endreq;
26
log << MSG::INFO <<
" MyBool = "
<< (int)m_myBool << endreq;
27
log << MSG::INFO <<
" MyDouble = "
<< m_myDouble << endreq;
28
29
for
(
unsigned
int
i=0; i<m_myStringVec.size(); i++) {
30
log << MSG::INFO <<
" MyStringVec["
<< i <<
"] = "
<< m_myStringVec[i]
31
<< endreq;
32
}
33
34
return
StatusCode::SUCCESS;
35
}
36
37
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
38
39
StatusCode
HelloWorld::execute
() {
40
41
// Part 1: Get the messaging service, print where you are
42
MsgStream log(
msgSvc
(), name());
43
log << MSG::INFO <<
"AtlasHelloWorld execute()"
<< endreq;
44
45
// Part 2: Print out the different levels of messages
46
log << MSG::DEBUG <<
"A DEBUG message"
<< endreq;
47
log << MSG::INFO <<
"An INFO message"
<< endreq;
48
log << MSG::WARNING <<
"A WARNING message"
<< endreq;
49
log << MSG::ERROR <<
"An ERROR message"
<< endreq;
50
log << MSG::FATAL <<
"A FATAL error message"
<< endreq;
51
52
return
StatusCode::SUCCESS;
53
}
54
55
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
56
57
StatusCode
HelloWorld::finalize
() {
58
59
// Part 1: Get the messaging service, print where you are
60
MsgStream log(
msgSvc
(), name());
61
log << MSG::INFO <<
"HelloWorld finalize()"
<< endreq;
62
63
return
StatusCode::SUCCESS;
64
}
65
HelloWorld.h
msgSvc
IMessageSvc * msgSvc()
Definition
ServiceAccessor.h:13
HelloWorld::execute
StatusCode execute()
Definition
HelloWorld.cxx:39
HelloWorld::HelloWorld
HelloWorld(const std::string &name, ISvcLocator *pSvcLocator)
Definition
HelloWorld.cxx:6
HelloWorld::initialize
StatusCode initialize()
Definition
HelloWorld.cxx:18
HelloWorld::finalize
StatusCode finalize()
Definition
HelloWorld.cxx:57
6.6.5.h
BesExamples
ExHelloWorld
ExHelloWorld-00-00-03
src
HelloWorld.cxx
Generated by
1.12.0