ATLAS Offline Software
Loading...
Searching...
No Matches
UnitTestTool1A.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
14
15//
16// method implementations
17//
18
19namespace asg
20{
21 UnitTestTool1A ::
22 UnitTestTool1A (const std::string& val_name)
23 : AsgTool (val_name)
24 {
25 declareProperty ("propertyInt", m_propertyInt, "the integer property");
26 declareProperty ("propertyString", m_propertyString, "the string property");
27 declareProperty ("initializeFail", m_initializeFail, "whether initialize should fail");
28 }
29
30
31
32 StatusCode UnitTestTool1A ::
33 initialize ()
34 {
36 {
37 ATH_MSG_ERROR ("tool configured to fail initialize");
38 return StatusCode::FAILURE;
39 }
41 {
42 ATH_MSG_ERROR ("initialize called twice");
43 return StatusCode::FAILURE;
44 }
45 m_isInitialized = true;
46 return StatusCode::SUCCESS;
47 }
48
49
50
51 std::string UnitTestTool1A ::
52 getPropertyString () const
53 {
54 return m_propertyString;
55 }
56
57
58
59 int UnitTestTool1A ::
60 getPropertyInt () const
61 {
62 return m_propertyInt;
63 }
64
65
66
67 void UnitTestTool1A ::
68 setPropertyInt (int val_property)
69 {
70 m_propertyInt = val_property;
71 }
72
73
74
75 bool UnitTestTool1A ::
76 isInitialized () const
77 {
78 return m_isInitialized;
79 }
80}
#define ATH_MSG_ERROR(x)
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
bool m_initializeFail
whether initialize should fail
bool m_isInitialized
whether initialize has been called
std::string m_propertyString
the string property
int m_propertyInt
the integer property