ATLAS Offline Software
UnitTestService1.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 
9 #ifndef ASG_TOOLS__UNIT_TEST_SERVICE1_H
10 #define ASG_TOOLS__UNIT_TEST_SERVICE1_H
11 
12 #include <AsgServices/AsgService.h>
14 
17 
18 namespace asg
19 {
24 
25  struct UnitTestService1 : virtual public IUnitTestService1,
26  public AsgService
27  {
29  public:
30  UnitTestService1 (const std::string& name, ISvcLocator* pSvcLocator);
31 
33  public:
35 
36  public:
37  StatusCode initialize () override;
38 
39  public:
40  virtual std::string getPropertyString () const override;
41 
42  public:
43  virtual int getPropertyInt () const override;
44 
45  public:
46  virtual void setPropertyInt (int val_property) override;
47 
48  public:
49  virtual bool isInitialized () const override;
50 
52  public:
53  bool m_isInitialized = false;
54 
56  public:
57  std::string m_propertyString;
58 
60  public:
61  int m_propertyInt = -7;
62 
64  public:
65  bool m_initializeFail = false;
66 
69  public:
70  static int& instance_counts (const std::string& name);
71  };
72 }
73 
74 #endif
asg::IUnitTestService1
the interface for UnitTestService1
Definition: IUnitTestService1.h:19
AsgService.h
asg::UnitTestService1::getPropertyString
virtual std::string getPropertyString() const override
get the integer property
Definition: UnitTestService1.cxx:79
asg
Definition: DataHandleTestTool.h:28
asg::UnitTestService1::getPropertyInt
virtual int getPropertyInt() const override
get the integer property
Definition: UnitTestService1.cxx:87
asg::UnitTestService1::UnitTestService1
UnitTestService1(const std::string &name, ISvcLocator *pSvcLocator)
standard constructor
Definition: UnitTestService1.cxx:29
asg::UnitTestService1::instance_counts
static int & instance_counts(const std::string &name)
the number of times the service of the given name has been instantiated
Definition: UnitTestService1.cxx:111
asg::UnitTestService1::m_initializeFail
bool m_initializeFail
whether initialize should fail
Definition: UnitTestService1.h:65
asg::UnitTestService1
a service used to unit test AnaToolHandle
Definition: UnitTestService1.h:27
ATLAS_NO_CHECK_FILE_THREAD_SAFETY
ATLAS_NO_CHECK_FILE_THREAD_SAFETY
Definition: UnitTestService1.h:16
asg::AsgService
Base class for the dual-use service implementation classes.
Definition: AsgService.h:43
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:46
asg::UnitTestService1::m_isInitialized
bool m_isInitialized
whether initialize has been called
Definition: UnitTestService1.h:53
asg::UnitTestService1::m_propertyInt
int m_propertyInt
the integer property
Definition: UnitTestService1.h:61
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
asg::UnitTestService1::isInitialized
virtual bool isInitialized() const override
get whether we have been initialized
Definition: UnitTestService1.cxx:103
asg::UnitTestService1::m_propertyString
std::string m_propertyString
the string property
Definition: UnitTestService1.h:57
asg::UnitTestService1::initialize
StatusCode initialize() override
set up/tear down functions
Definition: UnitTestService1.cxx:56
asg::UnitTestService1::setPropertyInt
virtual void setPropertyInt(int val_property) override
get the integer property
Definition: UnitTestService1.cxx:95
checker_macros.h
Define macros for attributes used to control the static checker.
IUnitTestService1.h