ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthToolSupport
AsgExampleTools
Root
UnitTestTool3.cxx
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
//
10
// includes
11
//
12
13
#include <
AsgExampleTools/UnitTestTool3.h
>
14
15
#include <
AsgExampleTools/IUnitTestTool1.h
>
16
#include <
AsgExampleTools/IUnitTestTool2.h
>
17
18
//
19
// method implementations
20
//
21
22
namespace
asg
23
{
24
UnitTestTool3 ::
25
UnitTestTool3 (
const
std::string& val_name)
26
:
AsgTool
(val_name),
27
m_subtool1
(
"asg::UnitTestTool1/subtool1"
, this),
28
m_subtool2
(
"asg::UnitTestTool2/subtool2"
, this)
29
{
30
declareProperty
(
"propertyName"
,
m_propertyName
=
"regPublicHandle"
);
31
declareProperty
(
"usePublic"
,
m_usePublic
);
32
declareProperty
(
"subtool0"
,
m_subtool0
);
33
34
m_subtool1
.setAllowEmpty ();
35
m_subtool1
.declarePropertyFor (
this
,
"subtool1"
);
36
}
37
38
39
40
StatusCode UnitTestTool3 ::
41
initialize ()
42
{
43
if
(!
m_usePublic
)
44
{
45
ANA_CHECK
(
m_subtool1
.setProperty (
"propertyInt"
, 42));
46
// ANA_CHECK (m_subtool1.initialize ());
47
ANA_CHECK
(
m_subtool2
.setProperty (
m_propertyName
,
m_subtool1
));
48
}
else
49
{
50
ANA_MSG_INFO
(
"using public handle"
);
51
ANA_CHECK
(
m_subtool2
.setProperty (
m_propertyName
,
m_subtool0
));
52
}
53
54
if
(
m_propertyName
!=
"regPublicHandle"
) {
55
ANA_CHECK
(
m_subtool2
.setProperty (
"regPublicHandle"
,
""
));
56
}
57
if
(
m_propertyName
!=
"regPrivateHandle"
) {
58
ANA_CHECK
(
m_subtool2
.setProperty (
"regPrivateHandle"
,
""
));
59
}
60
61
ANA_CHECK
(
m_subtool2
.setProperty (
"allowEmpty"
,
true
));
62
ANA_CHECK
(
m_subtool2
.initialize ());
63
64
return
StatusCode::SUCCESS;
65
}
66
67
68
69
const
IUnitTestTool1
*UnitTestTool3 ::
70
getSubtool ()
const
71
{
72
if
(
m_usePublic
)
73
return
&*
m_subtool0
;
74
else
75
return
m_subtool1
.get();
76
}
77
78
79
80
const
IUnitTestTool1
*UnitTestTool3 ::
81
getSubsubtool ()
const
82
{
83
return
m_subtool2
->getToolHandle (
m_propertyName
);
84
}
85
86
bool
UnitTestTool3 ::
87
subsubtoolEmpty ()
const
88
{
89
return
m_subtool2
->toolHandleEmpty (
m_propertyName
);
90
}
91
}
ANA_MSG_INFO
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:290
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
IUnitTestTool1.h
IUnitTestTool2.h
UnitTestTool3.h
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
asg::AsgTool::AsgTool
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition
AsgTool.cxx:58
asg::IUnitTestTool1
the interface for UnitTestTool1
Definition
IUnitTestTool1.h:19
asg
Definition
DataHandleTestTool.h:28
asg::UnitTestTool3::m_subtool2
AnaToolHandle< IUnitTestTool2 > m_subtool2
the tool we configure
Definition
UnitTestTool3.h:60
asg::UnitTestTool3::m_subtool1
AnaToolHandle< IUnitTestTool1 > m_subtool1
the tool the user configures
Definition
UnitTestTool3.h:56
asg::UnitTestTool3::m_propertyName
std::string m_propertyName
the property name we set on m_subsubtool
Definition
UnitTestTool3.h:64
asg::UnitTestTool3::m_usePublic
bool m_usePublic
whether to use the public tool handle
Definition
UnitTestTool3.h:68
asg::UnitTestTool3::m_subtool0
ToolHandle< IUnitTestTool1 > m_subtool0
a public tool handle the tool the user configures
Definition
UnitTestTool3.h:52
Generated on
for ATLAS Offline Software by
1.17.0