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
5 #include "HelloWorld.h"
6 
7 // Static Factory declaration
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 //------------------------------------------------------------------------------
20 //------------------------------------------------------------------------------
21  // avoid calling initialize more than once
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 //------------------------------------------------------------------------------
34 //------------------------------------------------------------------------------
35  MsgStream log( msgSvc(), name() );
36  log << MSG::INFO << "executing...." << endmsg;
37 
38  return StatusCode::SUCCESS;
39 }
40 
41 
42 //------------------------------------------------------------------------------
44 //------------------------------------------------------------------------------
45  MsgStream log(msgSvc(), name());
46  log << MSG::INFO << "finalizing...." << endmsg;
47 
48  m_initialized = false;
49  return StatusCode::SUCCESS;
50 }
51 //------------------------------------------------------------------------------
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 //------------------------------------------------------------------------------
64 //------------------------------------------------------------------------------
65  MsgStream log(msgSvc(), name());
66  log << MSG::INFO << "ending new run...." << endmsg;
67 
68  m_initialized = true;
69  return StatusCode::SUCCESS;
70 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
StatusCode endRun()
Algorithm end run. This method is called at the end of the event loop.
Definition: HelloWorld.cpp:63
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:26
#define DECLARE_COMPONENT(type)
Definition: PluginService.h:36
StatusCode execute()
The action to be performed by the algorithm on an event.
Definition: HelloWorld.cpp:33
StatusCode beginRun()
Algorithm begin run.
Definition: HelloWorld.cpp:52
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
virtual const std::string & name() const
The identifying name of the algorithm object.
Definition: Algorithm.cpp:837
Trivial Algorithm for tutotial purposes.
Definition: HelloWorld.h:15
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Algorithm.cpp:896
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:61
StatusCode initialize()
Three mandatory member functions of any algorithm.
Definition: HelloWorld.cpp:19
bool m_initialized
Definition: HelloWorld.h:27
StatusCode finalize()
the default (empty) implementation of IStateful::finalize() method
Definition: HelloWorld.cpp:43
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244