ATLAS Offline Software
Loading...
Searching...
No Matches
UnitTestService1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7
8
9//
10// includes
11//
12
15
16//
17// method implementations
18//
19
20namespace asg
21{
22 UnitTestService1 ::
23 UnitTestService1 (const std::string& name, ISvcLocator* pSvcLocator)
24 : base_class (name, pSvcLocator)
25 {
26 ANA_MSG_DEBUG ("create UnitTestService1 " << this);
27 }
28
29
30
31 UnitTestService1 ::
32 ~UnitTestService1 ()
33 {
34 ANA_MSG_DEBUG ("destroy UnitTestService1 " << this);
35 }
36
37
38
39 StatusCode UnitTestService1 ::
40 initialize ()
41 {
42 ANA_MSG_INFO ("initialize UnitTestService1 " << this);
43 ANA_MSG_INFO (" propertyString: " << m_propertyString);
44 ANA_MSG_INFO (" propertyInt: " << m_propertyInt);
45
47 {
48 ATH_MSG_ERROR ("service configured to fail initialize");
49 return StatusCode::FAILURE;
50 }
52 {
53 ATH_MSG_ERROR ("initialize called twice");
54 return StatusCode::FAILURE;
55 }
56 m_isInitialized = true;
57 return StatusCode::SUCCESS;
58 }
59
60
61
62 std::string UnitTestService1 ::
63 getPropertyString () const
64 {
65 return m_propertyString;
66 }
67
68
69
70 int UnitTestService1 ::
71 getPropertyInt () const
72 {
73 return m_propertyInt;
74 }
75
76
77
78 void UnitTestService1 ::
79 setPropertyInt (int val_property)
80 {
81 m_propertyInt = val_property;
82 }
83
84
85
86 bool UnitTestService1 ::
87 isInitialized () const
88 {
89 return m_isInitialized;
90 }
91
92}
#define ATH_MSG_ERROR(x)
macros for messaging and checking status codes
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
#define ANA_MSG_DEBUG(xmsg)
Macro printing debug messages.
bool m_isInitialized
whether initialize has been called
Gaudi::Property< int > m_propertyInt
the integer property
Gaudi::Property< bool > m_initializeFail
whether initialize should fail
Gaudi::Property< std::string > m_propertyString
the string property