ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthToolSupport
AsgExampleTools
Root
AsgHelloTool.cxx
Go to the documentation of this file.
1
// AsgHelloTool.cxx
2
3
#include "
AsgExampleTools/AsgHelloTool.h
"
4
5
//**********************************************************************
6
7
AsgHelloTool::
8
AsgHelloTool
(
const
std::string& myname )
9
:
AsgTool
(myname) {
10
declareProperty
(
"Message"
,
m_msg
);
11
}
12
13
//**********************************************************************
14
15
StatusCode
AsgHelloTool::initialize
() {
16
17
ATH_MSG_VERBOSE
(
"Initialising tool "
<< name() );
18
19
return
StatusCode::SUCCESS;
20
}
21
22
//**********************************************************************
23
24
int
AsgHelloTool::talk
()
const
{
25
ATH_MSG_DEBUG
(
"Talking..."
);
26
ATH_MSG_INFO
(
m_msg
);
27
// Create and execute a temporary tool.
28
if
( name() !=
"tmphello"
) {
29
AsgHelloTool
tmptool(
"tmphello"
);
30
if
( ! tmptool.setProperty(
"Message"
,
"Hi from the temporary tool."
).isSuccess() ) {
31
ATH_MSG_ERROR
(
"Failed to set property on temporary tool"
);
32
return
1;
33
}
34
tmptool.
talk
();
35
}
36
return
0;
37
}
38
//**********************************************************************
39
40
void
AsgHelloTool::print
()
const
{
41
AsgTool::print();
42
ATH_MSG_INFO
(
" Message: \""
<<
m_msg
<<
"\""
);
43
ATH_MSG_INFO
(
" MsgLevel: "
<<
MSG::name
(
msg
().currentLevel() ) );
44
ATH_MSG_ALWAYS
(
"This message always appears."
);
45
}
46
47
//**********************************************************************
AsgHelloTool.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
ATH_MSG_ALWAYS
#define ATH_MSG_ALWAYS(x)
Definition
AthMsgStreamMacros.h:35
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
AsgHelloTool::initialize
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition
AsgHelloTool.cxx:15
AsgHelloTool::m_msg
std::string m_msg
Definition
AsgHelloTool.h:33
AsgHelloTool::talk
virtual int talk() const
Definition
AsgHelloTool.cxx:24
AsgHelloTool::print
virtual void print() const
Print the state of the tool.
Definition
AsgHelloTool.cxx:40
AsgHelloTool::AsgHelloTool
AsgHelloTool(const std::string &myname)
Definition
AsgHelloTool.cxx:8
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
MSG::name
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition
MsgLevel.cxx:19
msg
MsgStream & msg
Definition
testRead.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0