| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

HelloWorld.cpp
Go to the documentation of this file.
1 // Include files
2 #include "HelloWorld.h"
3
4 // Static Factory declaration
5 DECLARE_COMPONENT(HelloWorld)
6
7 // Constructor
8 //------------------------------------------------------------------------------
9 HelloWorld::HelloWorld(const std::string& name, ISvcLocator* ploc)
10 : Algorithm(name, ploc) {
11 //------------------------------------------------------------------------------
12 m_initialized = false;
13 }
14
15 //------------------------------------------------------------------------------
16 StatusCode HelloWorld::initialize() {
17 //------------------------------------------------------------------------------
18 // avoid calling initialize more than once
19 if( m_initialized ) return StatusCode::SUCCESS;
20
21 info() << "initializing...." << endmsg;
22
23 m_initialized = true;
24 return StatusCode::SUCCESS;
25 }
26
27
28 //------------------------------------------------------------------------------
29 StatusCode HelloWorld::execute() {
30 //------------------------------------------------------------------------------
31 info() << "executing...." << endmsg;
32
33 return StatusCode::SUCCESS;
34 }
35
36
37 //------------------------------------------------------------------------------
38 StatusCode HelloWorld::finalize() {
39 //------------------------------------------------------------------------------
40 info() << "finalizing...." << endmsg;
41
42 m_initialized = false;
43 return StatusCode::SUCCESS;
44 }
45 //------------------------------------------------------------------------------
46 StatusCode HelloWorld::beginRun() {
47 //------------------------------------------------------------------------------
48 info() << "beginning new run...." << endmsg;
49
50 m_initialized = true;
51 return StatusCode::SUCCESS;
52 }
53
54
55 //------------------------------------------------------------------------------
56 StatusCode HelloWorld::endRun() {
57 //------------------------------------------------------------------------------
58 info() << "ending new run...." << endmsg;
59
60 m_initialized = true;
61 return StatusCode::SUCCESS;
62 }
HelloWorld::endRun
StatusCode endRun()
Definition: HelloWorld.cpp:56
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:28
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:124
std
STL namespace.
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginService.h:36
HelloWorld::execute
StatusCode execute()
Definition: HelloWorld.cpp:29
HelloWorld::beginRun
StatusCode beginRun()
Definition: HelloWorld.cpp:46
HelloWorld.h
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
HelloWorld
Trivial Algorithm for tutotial purposes.
Definition: HelloWorld.h:14
Algorithm
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:74
HelloWorld::initialize
StatusCode initialize()
Three mandatory member functions of any algorithm.
Definition: HelloWorld.cpp:16
HelloWorld::m_initialized
bool m_initialized
Definition: HelloWorld.h:26
HelloWorld::finalize
StatusCode finalize()
Definition: HelloWorld.cpp:38
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244