BOSS 7.0.5
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
6HelloWorld::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
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
39StatusCode 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
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
StatusCode execute()
Definition: HelloWorld.cxx:39
HelloWorld(const std::string &name, ISvcLocator *pSvcLocator)
Definition: HelloWorld.cxx:6
StatusCode initialize()
Definition: HelloWorld.cxx:18
StatusCode finalize()
Definition: HelloWorld.cxx:57