ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthToolSupport
AsgExampleTools
AsgExampleTools
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
>
13
#include <
AsgTools/PropertyWrapper.h
>
14
#include <
AsgExampleTools/IUnitTestTool1.h
>
15
#include <
CxxUtils/checker_macros.h
>
16
17
#include <mutex>
18
19
namespace
asg
20
{
25
26
struct
UnitTestTool1
:
virtual
public
IUnitTestTool1
,
27
public
AsgTool
28
{
29
public
:
30
ASG_TOOL_CLASS
(
UnitTestTool1
,
IUnitTestTool1
)
31
32
33
UnitTestTool1
(
const
std::string& val_name);
34
36
~UnitTestTool1
();
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
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition
AsgToolMacros.h:68
AsgTool.h
IUnitTestTool1.h
PropertyWrapper.h
checker_macros.h
Define macros for attributes used to control the static checker.
asg::AsgTool::AsgTool
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition
AsgTool.cxx:58
asg::IUnitTestTool1
the interface for UnitTestTool1
Definition
IUnitTestTool1.h:19
asg
Definition
DataHandleTestTool.h:28
asg::UnitTestTool1::setPropertyInt
virtual void setPropertyInt(int val_property) override
get the integer property
Definition
UnitTestTool1.cxx:87
asg::UnitTestTool1::instance_counts
static int instance_counts(const std::string &name)
the number of times the tool of the given name has been instantiated
Definition
UnitTestTool1.cxx:103
asg::UnitTestTool1::m_mutex
static std::mutex m_mutex
mutex for above map
Definition
UnitTestTool1.h:56
asg::UnitTestTool1::getPropertyInt
virtual int getPropertyInt() const override
get the integer property
Definition
UnitTestTool1.cxx:79
asg::UnitTestTool1::getPropertyString
virtual std::string getPropertyString() const override
get the integer property
Definition
UnitTestTool1.cxx:71
asg::UnitTestTool1::m_propertyString
Gaudi::Property< std::string > m_propertyString
the string property
Definition
UnitTestTool1.h:59
asg::UnitTestTool1::UnitTestTool1
UnitTestTool1(const std::string &val_name)
standard constructor
Definition
UnitTestTool1.cxx:25
asg::UnitTestTool1::ATLAS_THREAD_SAFE
static std::map< std::string, int > m_instances ATLAS_THREAD_SAFE
instance counts per name
Definition
UnitTestTool1.h:53
asg::UnitTestTool1::~UnitTestTool1
~UnitTestTool1()
standard destructor
Definition
UnitTestTool1.cxx:37
asg::UnitTestTool1::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition
UnitTestTool1.cxx:48
asg::UnitTestTool1::m_propertyInt
Gaudi::Property< int > m_propertyInt
the integer property
Definition
UnitTestTool1.h:62
asg::UnitTestTool1::m_initializeFail
Gaudi::Property< bool > m_initializeFail
whether initialize should fail
Definition
UnitTestTool1.h:65
asg::UnitTestTool1::isInitialized
virtual bool isInitialized() const override
get whether we have been initialized
Definition
UnitTestTool1.cxx:95
asg::UnitTestTool1::m_isInitialized
bool m_isInitialized
whether initialize has been called
Definition
UnitTestTool1.h:50
Generated on
for ATLAS Offline Software by
1.17.0