ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
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 More...
 
 ~UnitTestService1 ()
 standard destructor More...
 
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 More...
 
Gaudi::Property< std::string > m_propertyString {this, "propertyString", {}, "the string property"}
 the string property More...
 
Gaudi::Property< int > m_propertyInt {this, "propertyInt", -7, "the integer property"}
 the integer property More...
 
Gaudi::Property< bool > m_initializeFail {this, "initializeFail", false, "whether initialize should fail"}
 whether initialize should fail More...
 

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  }

◆ ~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  }

◆ getPropertyString()

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

Definition at line 62 of file UnitTestService1.cxx.

64  {
65  return m_propertyString;
66  }

◆ 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 
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  }

◆ 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.

◆ m_isInitialized

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

whether initialize has been called

Definition at line 40 of file UnitTestService1.h.

◆ 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.

◆ 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.


The documentation for this struct was generated from the following files:
asg::UnitTestService1::m_propertyString
Gaudi::Property< std::string > m_propertyString
the string property
Definition: UnitTestService1.h:43
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ANA_MSG_INFO
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:290
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::m_initializeFail
Gaudi::Property< bool > m_initializeFail
whether initialize should fail
Definition: UnitTestService1.h:49
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