ATLAS Offline Software
Loading...
Searching...
No Matches
UnitTestTool1.h
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#ifndef ASG_TOOLS__UNIT_TEST_TOOL1_H
10#define ASG_TOOLS__UNIT_TEST_TOOL1_H
11
12#include <AsgTools/AsgTool.h>
16
17#include <mutex>
18
19namespace asg
20{
25
26 struct UnitTestTool1 : virtual public IUnitTestTool1,
27 public AsgTool
28 {
29 public:
31
32
33 UnitTestTool1 (const std::string& val_name);
34
37
38 virtual StatusCode initialize () override;
39 virtual std::string getPropertyString () const override;
40 virtual int getPropertyInt () const override;
41 virtual void setPropertyInt (int val_property) override;
42 virtual bool isInitialized () const override;
43
46 static int instance_counts (const std::string& name);
47
48 private:
50 bool m_isInitialized = false;
51
53 inline static std::map<std::string, int> m_instances ATLAS_THREAD_SAFE;
54
56 inline static std::mutex m_mutex;
57
59 Gaudi::Property<std::string> m_propertyString{this, "propertyString", {}, "the string property"};
60
62 Gaudi::Property<int> m_propertyInt{this, "propertyInt", 0, "the integer property"};
63
65 Gaudi::Property<bool> m_initializeFail{this, "initializeFail", false, "whether initialize should fail"};
66 };
67}
68
69#endif
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Define macros for attributes used to control the static checker.
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
the interface for UnitTestTool1
virtual void setPropertyInt(int val_property) override
get the integer property
static int instance_counts(const std::string &name)
the number of times the tool of the given name has been instantiated
static std::mutex m_mutex
mutex for above map
virtual int getPropertyInt() const override
get the integer property
virtual std::string getPropertyString() const override
get the integer property
Gaudi::Property< std::string > m_propertyString
the string property
UnitTestTool1(const std::string &val_name)
standard constructor
static std::map< std::string, int > m_instances ATLAS_THREAD_SAFE
instance counts per name
~UnitTestTool1()
standard destructor
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Gaudi::Property< int > m_propertyInt
the integer property
Gaudi::Property< bool > m_initializeFail
whether initialize should fail
virtual bool isInitialized() const override
get whether we have been initialized
bool m_isInitialized
whether initialize has been called