ATLAS Offline Software
Loading...
Searching...
No Matches
AsgHelloTool.cxx
Go to the documentation of this file.
1// AsgHelloTool.cxx
2
4
5//**********************************************************************
6
8AsgHelloTool( const std::string& myname )
9: AsgTool(myname) {
10 declareProperty("Message", m_msg);
11}
12
13//**********************************************************************
14
16
17 ATH_MSG_VERBOSE( "Initialising tool " << name() );
18
19 return StatusCode::SUCCESS;
20}
21
22//**********************************************************************
23
24int AsgHelloTool::talk() const {
25 ATH_MSG_DEBUG("Talking...");
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
40void 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//**********************************************************************
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_ALWAYS(x)
#define ATH_MSG_DEBUG(x)
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
std::string m_msg
virtual int talk() const
virtual void print() const
Print the state of the tool.
AsgHelloTool(const std::string &myname)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition MsgLevel.cxx:19
MsgStream & msg
Definition testRead.cxx:32