The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
MyAlgorithm.h
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2023 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#pragma once
12
13#include "IMyTool.h"
15
22public:
24 MyAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
25
27 StatusCode initialize() override;
28 StatusCode execute() override;
29 StatusCode finalize() override;
30
31 bool isClonable() const override { return true; }
32
33private:
34 Gaudi::Property<std::string> m_privateToolType{ this, "ToolWithName", "MyTool",
35 "Type of the tool to use (internal name is ToolWithName)" };
36 Gaudi::Property<bool> m_privateToolsOnly{ this, "PrivateToolsOnly", false, "Do not look for public tools." };
37
40
42
44
45 ToolHandle<IMyTool> m_legacyToolHandle{ "MyTool/LegacyToolHandle", this };
46
47 ToolHandle<IMyTool> m_myPrivToolHandle{ this, "PrivToolHandle", "MyTool/PrivToolHandle" };
48 PublicToolHandle<IMyTool> m_myPubToolHandle{ this, "PubToolHandle", "MyTool/PubToolHandle" };
49
50 PublicToolHandle<IAlgTool> m_myGenericToolHandle{ this, "GenericToolHandle", "MyTool/GenericToolHandle" };
51
52 ToolHandle<IAlgTool> m_myUnusedToolHandle{ this, "UnusedToolHandle", "TestToolFailing/UnusedToolHandle" };
53
55 ToolHandle<IMyTool> m_invalidToolHandle{ this, "InvalidToolHandle", "TestToolFailing" };
56
57 ToolHandle<IWrongTool> m_wrongIfaceTool{ this, "WrongIfaceTool", "MyTool/WrongIfaceTool" };
58
59 PublicToolHandle<const IMyTool> m_myConstToolHandle{ "MyTool/ConstGenericToolHandle" };
60
64
66 "MyPublicToolHandleArrayProperty",
67 { "MyTool/AnotherConstGenericToolHandle", "MyTool/AnotherInstanceOfMyTool" } };
68};
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
Second interface, to test multiple interface tools.
Definition IMyTool.h:38
Example of an Interface of a Algorithm Tool.
Definition IMyTool.h:21
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition ISvcLocator.h:42
ToolHandle< IMyTool > m_invalidToolHandle
Definition MyAlgorithm.h:55
PublicToolHandle< IMyTool > m_myCopiedToolHandle
Definition MyAlgorithm.h:63
PublicToolHandle< const IMyTool > m_myCopiedConstToolHandle2
Definition MyAlgorithm.h:62
StatusCode finalize() override
StatusCode initialize() override
Three mandatory member functions of any algorithm.
IMyTool * m_privateToolWithName
Definition MyAlgorithm.h:41
PublicToolHandle< IAlgTool > m_myGenericToolHandle
Definition MyAlgorithm.h:50
IMyTool * m_publicTool
Definition MyAlgorithm.h:39
Gaudi::Property< std::string > m_privateToolType
Definition MyAlgorithm.h:34
PublicToolHandle< const IMyTool > m_myConstToolHandle
Definition MyAlgorithm.h:59
bool isClonable() const override
Definition MyAlgorithm.h:31
PublicToolHandle< const IMyTool > m_myCopiedConstToolHandle
Definition MyAlgorithm.h:61
ToolHandle< IMyTool > m_myPrivToolHandle
Definition MyAlgorithm.h:47
StatusCode execute() override
MyAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor of this form must be provided or inherited from the base class.
IMyOtherTool * m_privateOtherInterface
Definition MyAlgorithm.h:43
ToolHandle< IMyTool > m_legacyToolHandle
Definition MyAlgorithm.h:45
PublicToolHandleArray< IMyTool > m_tha
Definition MyAlgorithm.h:65
IMyTool * m_privateTool
Definition MyAlgorithm.h:38
Gaudi::Property< bool > m_privateToolsOnly
Definition MyAlgorithm.h:36
ToolHandle< IAlgTool > m_myUnusedToolHandle
Definition MyAlgorithm.h:52
ToolHandle< IMyTool > m_undefinedToolHandle
Definition MyAlgorithm.h:54
ToolHandle< IWrongTool > m_wrongIfaceTool
Definition MyAlgorithm.h:57
PublicToolHandle< IMyTool > m_myPubToolHandle
Definition MyAlgorithm.h:48
Helper class to construct ToolHandle instances for public tools via the auto registering constructor.
Definition ToolHandle.h:459
Helper class to construct ToolHandle instances for public tools via the auto registering constructor.
Definition ToolHandle.h:357
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
Handle to be used in lieu of naked pointers to tools.
Definition ToolHandle.h:132
Simple algorithm useful as base class for tests.
Definition TestAlg.h:19