ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthToolSupport
AsgExampleTools
Root
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
13
#include <
AsgExampleTools/UnitTestService1.h
>
14
#include <
AsgMessaging/MessageCheck.h
>
15
16
//
17
// method implementations
18
//
19
20
namespace
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
46
if
(
m_initializeFail
)
47
{
48
ATH_MSG_ERROR
(
"service configured to fail initialize"
);
49
return
StatusCode::FAILURE;
50
}
51
if
(
m_isInitialized
)
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
}
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
MessageCheck.h
macros for messaging and checking status codes
ANA_MSG_INFO
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:290
ANA_MSG_DEBUG
#define ANA_MSG_DEBUG(xmsg)
Macro printing debug messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:288
UnitTestService1.h
asg
Definition
DataHandleTestTool.h:28
asg::UnitTestService1::m_isInitialized
bool m_isInitialized
whether initialize has been called
Definition
UnitTestService1.h:40
asg::UnitTestService1::m_propertyInt
Gaudi::Property< int > m_propertyInt
the integer property
Definition
UnitTestService1.h:46
asg::UnitTestService1::m_initializeFail
Gaudi::Property< bool > m_initializeFail
whether initialize should fail
Definition
UnitTestService1.h:49
asg::UnitTestService1::m_propertyString
Gaudi::Property< std::string > m_propertyString
the string property
Definition
UnitTestService1.h:43
Generated on
for ATLAS Offline Software by
1.17.0