The Gaudi Framework  master (82fdf313)
Loading...
Searching...
No Matches
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"
15
16// Static Factory declaration
17
19
20// Constructor
21//------------------------------------------------------------------------------
22HelloWorld::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
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;
45}
46
47//------------------------------------------------------------------------------
49 //------------------------------------------------------------------------------
50 info() << "executing...." << endmsg;
51
53}
54
55//------------------------------------------------------------------------------
57 //------------------------------------------------------------------------------
58 info() << "finalizing...." << endmsg;
59
60 m_initialized = false;
62}
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition MsgStream.h:198
#define DECLARE_COMPONENT(type)
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Algorithm(std::string name, ISvcLocator *svcloc, std::string version=PACKAGE_VERSION)
Constructor.
Definition Algorithm.h:98
void declareInfo(const std::string &name, const T &var, const std::string &desc) const
Declare monitoring information.
Definition Algorithm.h:324
const std::string & name() const override
The identifying name of the algorithm object.
Implementation of property with value of concrete type.
Definition PropertyFwd.h:27
Trivial Algorithm for tutotial purposes.
Definition HelloWorld.h:23
Gaudi::Property< std::string > m_string
Definition HelloWorld.h:39
StatusCode initialize() override
Three mandatory member functions of any algorithm.
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:37
Gaudi::Property< double > m_double
Definition HelloWorld.h:38
bool m_initialized
Definition HelloWorld.h:34
HelloWorld(const std::string &name, ISvcLocator *pSvcLocator)
Constructor of this form must be provided.
StatusCode execute() override
StatusCode finalize() override
double t_double
Definition HelloWorld.h:41
std::string t_string
Definition HelloWorld.h:42
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition ISvcLocator.h:42
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
constexpr static const auto SUCCESS
Definition StatusCode.h:99
STL namespace.