ATLAS Offline Software
Loading...
Searching...
No Matches
asg::UnitTestService1 Struct Reference

a service used to unit test AnaToolHandle More...

#include <UnitTestService1.h>

Inheritance diagram for asg::UnitTestService1:
Collaboration diagram for asg::UnitTestService1:

Public Member Functions

 UnitTestService1 (const std::string &name, ISvcLocator *pSvcLocator)
 standard constructor
 ~UnitTestService1 ()
 standard destructor
virtual StatusCode initialize () override
virtual std::string getPropertyString () const override
virtual int getPropertyInt () const override
virtual void setPropertyInt (int val_property) override
virtual bool isInitialized () const override

Private Attributes

bool m_isInitialized {false}
 whether initialize has been called
Gaudi::Property< std::string > m_propertyString {this, "propertyString", {}, "the string property"}
 the string property
Gaudi::Property< int > m_propertyInt {this, "propertyInt", -7, "the integer property"}
 the integer property
Gaudi::Property< bool > m_initializeFail {this, "initializeFail", false, "whether initialize should fail"}
 whether initialize should fail

Detailed Description

a service used to unit test AnaToolHandle

This allows to unit test the various capabilities of AnaToolHandle in a controlled fashion.

Definition at line 23 of file UnitTestService1.h.

Constructor & Destructor Documentation

◆ UnitTestService1()

asg::UnitTestService1::UnitTestService1 ( const std::string & name,
ISvcLocator * pSvcLocator )

standard constructor

Definition at line 22 of file UnitTestService1.cxx.

24 : base_class (name, pSvcLocator)
25 {
26 ANA_MSG_DEBUG ("create UnitTestService1 " << this);
27 }
#define ANA_MSG_DEBUG(xmsg)
Macro printing debug messages.

◆ ~UnitTestService1()

asg::UnitTestService1::~UnitTestService1 ( )

standard destructor

Definition at line 31 of file UnitTestService1.cxx.

33 {
34 ANA_MSG_DEBUG ("destroy UnitTestService1 " << this);
35 }

Member Function Documentation

◆ getPropertyInt()

int asg::UnitTestService1::getPropertyInt ( ) const
overridevirtual

Definition at line 70 of file UnitTestService1.cxx.

72 {
73 return m_propertyInt;
74 }
Gaudi::Property< int > m_propertyInt
the integer property

◆ getPropertyString()

std::string asg::UnitTestService1::getPropertyString ( ) const
overridevirtual

Definition at line 62 of file UnitTestService1.cxx.

64 {
65 return m_propertyString;
66 }
Gaudi::Property< std::string > m_propertyString
the string property

◆ initialize()

StatusCode asg::UnitTestService1::initialize ( )
overridevirtual

Definition at line 39 of file UnitTestService1.cxx.

41 {
42 ANA_MSG_INFO ("initialize UnitTestService1 " << this);
43 ANA_MSG_INFO (" propertyString: " << m_propertyString);
44 ANA_MSG_INFO (" propertyInt: " << m_propertyInt);
45
47 {
48 ATH_MSG_ERROR ("service configured to fail initialize");
49 return StatusCode::FAILURE;
50 }
52 {
53 ATH_MSG_ERROR ("initialize called twice");
54 return StatusCode::FAILURE;
55 }
56 m_isInitialized = true;
57 return StatusCode::SUCCESS;
58 }
#define ATH_MSG_ERROR(x)
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
bool m_isInitialized
whether initialize has been called
Gaudi::Property< bool > m_initializeFail
whether initialize should fail

◆ isInitialized()

bool asg::UnitTestService1::isInitialized ( ) const
overridevirtual

Definition at line 86 of file UnitTestService1.cxx.

88 {
89 return m_isInitialized;
90 }

◆ setPropertyInt()

void asg::UnitTestService1::setPropertyInt ( int val_property)
overridevirtual

Definition at line 78 of file UnitTestService1.cxx.

80 {
81 m_propertyInt = val_property;
82 }

Member Data Documentation

◆ m_initializeFail

Gaudi::Property<bool> asg::UnitTestService1::m_initializeFail {this, "initializeFail", false, "whether initialize should fail"}
private

whether initialize should fail

Definition at line 49 of file UnitTestService1.h.

49{this, "initializeFail", false, "whether initialize should fail"};

◆ m_isInitialized

bool asg::UnitTestService1::m_isInitialized {false}
private

whether initialize has been called

Definition at line 40 of file UnitTestService1.h.

40{false};

◆ m_propertyInt

Gaudi::Property<int> asg::UnitTestService1::m_propertyInt {this, "propertyInt", -7, "the integer property"}
private

the integer property

Definition at line 46 of file UnitTestService1.h.

46{this, "propertyInt", -7, "the integer property"};

◆ m_propertyString

Gaudi::Property<std::string> asg::UnitTestService1::m_propertyString {this, "propertyString", {}, "the string property"}
private

the string property

Definition at line 43 of file UnitTestService1.h.

43{this, "propertyString", {}, "the string property"};

The documentation for this struct was generated from the following files: