The Gaudi Framework  master (37c0b60a)
HelloWorld.cpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 // Include files
12 #include "HelloWorld.h"
13 #include <GaudiKernel/DataObject.h>
15 
16 // Static Factory declaration
17 
19 
20 // Constructor
21 //------------------------------------------------------------------------------
22 HelloWorld::HelloWorld( const std::string& name, ISvcLocator* ploc ) : Algorithm( name, ploc ) {
23  //------------------------------------------------------------------------------
24  m_initialized = false;
25 }
26 
27 //------------------------------------------------------------------------------
29  //------------------------------------------------------------------------------
30  // avoid calling initialize more than once
31  if ( m_initialized ) return StatusCode::SUCCESS;
32 
33  info() << "initializing...." << endmsg;
34 
38 
39  declareInfo( "int_value", t_int, "description" );
40  declareInfo( "double_value", t_double, "description" );
41  declareInfo( "string_value", t_string, "description" );
42 
43  m_initialized = true;
44  return StatusCode::SUCCESS;
45 }
46 
47 //------------------------------------------------------------------------------
49  //------------------------------------------------------------------------------
50  info() << "executing...." << endmsg;
51 
52  return StatusCode::SUCCESS;
53 }
54 
55 //------------------------------------------------------------------------------
57  //------------------------------------------------------------------------------
58  info() << "finalizing...." << endmsg;
59 
60  m_initialized = false;
61  return StatusCode::SUCCESS;
62 }
HelloWorld::t_double
double t_double
Definition: HelloWorld.h:42
HelloWorld::m_int
Gaudi::Property< int > m_int
These data members are used in the execution of this algorithm They are set in the initialisation pha...
Definition: HelloWorld.h:38
HelloWorld.h
HelloWorld::t_string
std::string t_string
Definition: HelloWorld.h:43
HelloWorld::t_int
int t_int
Definition: HelloWorld.h:41
ISvcLocator
Definition: ISvcLocator.h:46
Algorithm
Alias for backward compatibility.
Definition: Algorithm.h:58
HelloWorld::m_string
Gaudi::Property< std::string > m_string
Definition: HelloWorld.h:40
HelloWorld::initialize
StatusCode initialize() override
Three mandatory member functions of any algorithm.
Definition: HelloWorld.cpp:28
IDataProviderSvc.h
StatusCode
Definition: StatusCode.h:65
HelloWorld
Definition: HelloWorld.h:24
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
HelloWorld::execute
StatusCode execute() override
Definition: HelloWorld.cpp:48
HelloWorld::m_initialized
bool m_initialized
Definition: HelloWorld.h:35
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77
DataObject.h
std
STL namespace.
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginServiceV1.h:46
HelloWorld::finalize
StatusCode finalize() override
Definition: HelloWorld.cpp:56
Gaudi::Algorithm::declareInfo
void declareInfo(const std::string &name, const T &var, const std::string &desc) const
Declare monitoring information.
Definition: Algorithm.h:344
HelloWorld::m_double
Gaudi::Property< double > m_double
Definition: HelloWorld.h:39
Gaudi::Property< int >