Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 
20 namespace asg
21 {
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 
33  {
34  ANA_MSG_DEBUG ("destroy UnitTestService1 " << this);
35  }
36 
37 
38 
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 
71  getPropertyInt () const
72  {
73  return m_propertyInt;
74  }
75 
76 
77 
79  setPropertyInt (int val_property)
80  {
81  m_propertyInt = val_property;
82  }
83 
84 
85 
87  isInitialized () const
88  {
89  return m_isInitialized;
90  }
91 
92 }
asg::UnitTestService1::getPropertyString
virtual std::string getPropertyString() const override
Definition: UnitTestService1.cxx:63
asg
Definition: DataHandleTestTool.h:28
asg::UnitTestService1::m_propertyString
Gaudi::Property< std::string > m_propertyString
the string property
Definition: UnitTestService1.h:43
asg::UnitTestService1::getPropertyInt
virtual int getPropertyInt() const override
Definition: UnitTestService1.cxx:71
asg::UnitTestService1::UnitTestService1
UnitTestService1(const std::string &name, ISvcLocator *pSvcLocator)
standard constructor
Definition: UnitTestService1.cxx:23
UnitTestService1.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
asg::UnitTestService1::~UnitTestService1
~UnitTestService1()
standard destructor
Definition: UnitTestService1.cxx:32
ANA_MSG_INFO
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:290
MessageCheck.h
macros for messaging and checking status codes
asg::UnitTestService1::m_isInitialized
bool m_isInitialized
whether initialize has been called
Definition: UnitTestService1.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
asg::UnitTestService1::isInitialized
virtual bool isInitialized() const override
Definition: UnitTestService1.cxx:87
asg::UnitTestService1::initialize
virtual StatusCode initialize() override
Definition: UnitTestService1.cxx:40
asg::UnitTestService1::m_initializeFail
Gaudi::Property< bool > m_initializeFail
whether initialize should fail
Definition: UnitTestService1.h:49
asg::UnitTestService1::setPropertyInt
virtual void setPropertyInt(int val_property) override
Definition: UnitTestService1.cxx:79
ANA_MSG_DEBUG
#define ANA_MSG_DEBUG(xmsg)
Macro printing debug messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:288
asg::UnitTestService1::m_propertyInt
Gaudi::Property< int > m_propertyInt
the integer property
Definition: UnitTestService1.h:46