ATLAS Offline Software
Loading...
Searching...
No Matches
HelloAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ATHEXHELLOWORLD_HELLOALG_H
6#define ATHEXHELLOWORLD_HELLOALG_H
7
9#include "Gaudi/Property.h"
10#include "GaudiKernel/ToolHandle.h"
11
12#include <map>
13#include <string>
14#include <utility>
15#include <vector>
16
17class IHelloTool;
18
19class HelloAlg : public AthAlgorithm {
20 public:
21 HelloAlg(const std::string &name, ISvcLocator *pSvcLocator);
22
23 virtual StatusCode initialize() override;
24 virtual StatusCode execute() override;
25 virtual StatusCode finalize() override;
26
27 private:
28 // Properties
29 Gaudi::Property<int> m_myInt{this, "MyInt", 0, "An Integer"};
30 Gaudi::Property<bool> m_myBool{this, "MyBool", false, "A Bool"};
31 Gaudi::Property<double> m_myDouble{this, "MyDouble", 0., "A Double"};
32
33 Gaudi::Property<std::vector<std::string>> m_myStringVec{
34 this, "MyStringVec", {}, "an entire vector of strings"};
35
36 typedef std::map<std::string, std::string> Dict_t;
37 Gaudi::Property<Dict_t> m_myDict{this, "MyDict", {}, "A little dictionary"};
38
39 typedef std::vector<std::vector<double>> Matrix_t;
40 Gaudi::Property<Matrix_t> m_myMatrix{
41 this, "MyMatrix", {}, "A matrix of doubles"};
42
43 // legacy style Property
44 typedef std::vector<std::pair<double, double>> Table_t;
46
47 // ToolHandles as Properties
48 ToolHandle<IHelloTool> m_myPrivateHelloTool{
49 this, "MyPrivateHelloTool", "HelloTool", "private IHelloTool"};
50
51 PublicToolHandle<IHelloTool> m_myPublicHelloTool{
52 this, "MyPublicHelloTool", "HelloTool", "public, shared IHelloTool"};
53};
54
55#endif
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Property< Matrix_t > m_myMatrix
Definition HelloAlg.h:40
ToolHandle< IHelloTool > m_myPrivateHelloTool
Definition HelloAlg.h:48
Gaudi::Property< bool > m_myBool
Definition HelloAlg.h:30
Gaudi::Property< int > m_myInt
Definition HelloAlg.h:29
Table_t m_myTable
Definition HelloAlg.h:45
PublicToolHandle< IHelloTool > m_myPublicHelloTool
Definition HelloAlg.h:51
virtual StatusCode finalize() override
Definition HelloAlg.cxx:96
std::vector< std::vector< double > > Matrix_t
Definition HelloAlg.h:39
virtual StatusCode execute() override
Definition HelloAlg.cxx:72
Gaudi::Property< std::vector< std::string > > m_myStringVec
Definition HelloAlg.h:33
std::map< std::string, std::string > Dict_t
Definition HelloAlg.h:36
Gaudi::Property< double > m_myDouble
Definition HelloAlg.h:31
HelloAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition HelloAlg.cxx:9
virtual StatusCode initialize() override
Definition HelloAlg.cxx:25
Gaudi::Property< Dict_t > m_myDict
Definition HelloAlg.h:37
std::vector< std::pair< double, double > > Table_t
Definition HelloAlg.h:44