UnitTestService1.h 1.56 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/

/// @author Nils Krumnack



#ifndef ASG_TOOLS__UNIT_TEST_SERVICE1_H
#define ASG_TOOLS__UNIT_TEST_SERVICE1_H

#include <AsgServices/AsgService.h>
#include <AsgExampleTools/IUnitTestService1.h>

namespace asg
{
  /// \brief a service used to unit test AnaToolHandle
  ///
  /// This allows to unit test the various capabilities of
  /// AnaToolHandle in a controlled fashion.

  struct UnitTestService1 : virtual public IUnitTestService1,
                            public AsgService
  {
    /// \brief standard constructor
  public:
    UnitTestService1 (const std::string& name, ISvcLocator* pSvcLocator);

    /// \brief standard destructor
  public:
    ~UnitTestService1 ();

  public:
    StatusCode initialize () override;

  public:
    virtual std::string getPropertyString () const override;

  public:
    virtual int getPropertyInt () const override;

  public:
    virtual void setPropertyInt (int val_property) override;

  public:
    virtual bool isInitialized () const override;

    /// \brief whether initialize has been called
  public:
    bool m_isInitialized = false;

    /// \brief the string property
  public:
    std::string m_propertyString;

    /// \brief the integer property
  public:
    int m_propertyInt = -7;

    /// \brief whether initialize should fail
  public:
    bool m_initializeFail = false;

    /// \brief the number of times the service of the given name has been
    /// instantiated
  public:
    static int& instance_counts (const std::string& name);
  };
}

#endif