ATLAS Offline Software
UnitTestTool2.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 
9 #ifndef ASG_TOOLS__UNIT_TEST_TOOL2_H
10 #define ASG_TOOLS__UNIT_TEST_TOOL2_H
11 
12 #include <AsgTools/AnaToolHandle.h>
13 #include <AsgTools/AsgTool.h>
15 
16 namespace asg
17 {
22 
23  struct UnitTestTool2 : virtual public IUnitTestTool2,
24  public AsgTool
25  {
27 
28 
29  public:
30  UnitTestTool2 (const std::string& val_name);
31 
32  public:
33  StatusCode initialize () override;
34 
35  public:
36  virtual bool
37  toolHandleEmpty (const std::string& handleName) const override;
38 
39  public:
40  virtual const IUnitTestTool1 *
41  getToolHandle (const std::string& handleName) const override;
42 
43  public:
44  virtual StatusCode
45  retrieveToolHandle (const std::string& handleName) const override;
46 
47  public:
48  virtual bool
49  wasUserConfigured (const std::string& handleName) const override;
50 
51  public:
52  virtual const ToolHandleArray<IUnitTestTool1>&
53  getArray () const override;
54 
55  public:
56  ToolHandle<IUnitTestTool1> m_regPublicHandle;
57 
58  public:
59  ToolHandle<IUnitTestTool1> m_regPrivateHandle;
60 
61  public:
63 
64  public:
66 
67  public:
68  ToolHandleArray<IUnitTestTool1> m_regPrivateArray {
69  this, "regPrivateArray", {}, "array of private tools"};
70 
71  private:
73 
74  private:
76 
77  private:
78  bool m_allowEmpty = false;
79  };
80 }
81 
82 #endif
asg::UnitTestTool2::m_wasUserConfiguredPrivate
bool m_wasUserConfiguredPrivate
Definition: UnitTestTool2.h:75
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
asg::AnaToolHandle
a modified tool handle that allows its owner to configure new tools from the C++ side
Definition: AnaToolHandle.h:34
asg::UnitTestTool2::m_allowEmpty
bool m_allowEmpty
Definition: UnitTestTool2.h:78
asg::UnitTestTool2::m_regPrivateArray
ToolHandleArray< IUnitTestTool1 > m_regPrivateArray
Definition: UnitTestTool2.h:68
asg::UnitTestTool2::toolHandleEmpty
virtual bool toolHandleEmpty(const std::string &handleName) const override
whether the given ToolHandle is empty
Definition: UnitTestTool2.cxx:64
asg::UnitTestTool2::m_anaPublicHandle
AnaToolHandle< IUnitTestTool1 > m_anaPublicHandle
Definition: UnitTestTool2.h:62
asg
Definition: DataHandleTestTool.h:28
asg::IUnitTestTool1
the interface for UnitTestTool1
Definition: IUnitTestTool1.h:19
asg::UnitTestTool2::m_wasUserConfiguredPublic
bool m_wasUserConfiguredPublic
Definition: UnitTestTool2.h:72
asg::UnitTestTool2::wasUserConfigured
virtual bool wasUserConfigured(const std::string &handleName) const override
whether the AnaToolHandle was user configured
Definition: UnitTestTool2.cxx:108
asg::UnitTestTool2::getArray
virtual const ToolHandleArray< IUnitTestTool1 > & getArray() const override
get the tool handle array
Definition: UnitTestTool2.cxx:120
asg::UnitTestTool2::m_anaPrivateHandle
AnaToolHandle< IUnitTestTool1 > m_anaPrivateHandle
Definition: UnitTestTool2.h:65
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
asg::IUnitTestTool2
the interface for UnitTestTool2
Definition: IUnitTestTool2.h:22
IUnitTestTool2.h
asg::UnitTestTool2::initialize
StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: UnitTestTool2.cxx:42
AnaToolHandle.h
asg::UnitTestTool2::retrieveToolHandle
virtual StatusCode retrieveToolHandle(const std::string &handleName) const override
call retrieve on the regular ToolHandle
Definition: UnitTestTool2.cxx:96
asg::UnitTestTool2::UnitTestTool2
UnitTestTool2(const std::string &val_name)
standard constructor
Definition: UnitTestTool2.cxx:24
asg::UnitTestTool2::getToolHandle
virtual const IUnitTestTool1 * getToolHandle(const std::string &handleName) const override
get the tool from the regular ToolHandle
Definition: UnitTestTool2.cxx:80
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
asg::UnitTestTool2::m_regPrivateHandle
ToolHandle< IUnitTestTool1 > m_regPrivateHandle
Definition: UnitTestTool2.h:59
asg::UnitTestTool2::m_regPublicHandle
ToolHandle< IUnitTestTool1 > m_regPublicHandle
Definition: UnitTestTool2.h:56
AsgTool.h
asg::UnitTestTool2
a tool used to unit test AnaToolHandle
Definition: UnitTestTool2.h:25