ATLAS Offline Software
Loading...
Searching...
No Matches
AsgTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ASGTOOLS_ASGTOOL_H
6#define ASGTOOLS_ASGTOOL_H
7
8// Athena include(s).
9#include "SGCore/sgkey_t.h"
10
11// Local include(s):
12#include "AsgTools/IAsgTool.h"
15
16// Environment specific include(s):
17#ifdef XAOD_STANDALONE
20# include "AsgTools/SgTEvent.h"
21 // Forward declaration(s):
22#else // XAOD_STANDALONE
24#endif // XAOD_STANDALONE
25
26// System include(s).
27#include <string>
28
29namespace asg {
30
31 // Declare the type name of AsgTool's base class
32#ifndef XAOD_STANDALONE
34#else // not XAOD_STANDALONE
35 typedef AsgComponent AsgToolBase;
36#endif // not XAOD_STANDALONE
37
46 class AsgTool : public virtual IAsgTool,
47 public AsgToolBase {
48
49 public:
51 AsgTool( const std::string& name );
53 ~AsgTool();
54
55 AsgTool (const AsgTool&) = delete;
56 AsgTool& operator= (const AsgTool&) = delete;
57
58
59#ifdef XAOD_STANDALONE
60
62 SgTEvent* evtStore() const;
63
64 // this is just so that my template functions can find this
65 // method in the base class.
66 public:
67 using AsgToolBase::msg;
68
69#endif // XAOD_STANDALONE
70
71#ifndef XAOD_STANDALONE
72 public:
74 using ::AthAlgTool::getProperty;
75
76#endif // not XAOD_STANDALONE
77
80
82 template< class T >
83 const T* getProperty( const std::string& name ) const;
84
86 const std::string& msg_level_name() const __attribute__ ((deprecated));
87
105 const std::string& getName( const void* ptr ) const;
106
124 SG::sgkey_t getKey( const void* ptr ) const;
125
127
133 virtual StatusCode initialize() { return StatusCode::SUCCESS; }
134
136 virtual void print() const;
137
138 private:
139#ifdef XAOD_STANDALONE
140 mutable SgTEvent m_event;
141#endif // XAOD_STANDALONE
142
143 }; // class AsgTool
144
145} // namespace asg
146
147// Include the implementation of the template functions:
148#include "AsgTools/AsgTool.icc"
149
150// Include static methods for working with AsgTools
151#include "AsgTools/SetProperty.h"
152
153#endif // ASGTOOLS_ASGTOOL_H
macros for messaging and checking status codes
Definition of message levels and a helper function.
__attribute__((always_inline)) inline uint16_t TileCalibDrawerBase
ServiceHandle< StoreGateSvc > & evtStore()
MsgStream & msg() const
const T * getProperty(const std::string &name) const
Get one of the tool's properties.
const std::string & msg_level_name() const __attribute__((deprecated))
A deprecated function for getting the message level's name.
Definition AsgTool.cxx:101
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition AsgTool.h:133
const std::string & getName(const void *ptr) const
Get the name of an object that is / should be in the event store.
Definition AsgTool.cxx:106
AsgTool & operator=(const AsgTool &)=delete
~AsgTool()
Destructor.
Definition AsgTool.cxx:73
virtual void print() const
Print the state of the tool.
Definition AsgTool.cxx:131
SG::sgkey_t getKey(const void *ptr) const
Get the (hashed) key of an object that is in the event store.
Definition AsgTool.cxx:119
AsgTool(const AsgTool &)=delete
Base class for the dual-use tool interface classes.
Definition IAsgTool.h:41
Wrapper for TEvent to make it look like StoreGate.
Definition SgTEvent.h:44
Forward declaration.
::AthAlgTool AsgToolBase
Definition AsgTool.h:33
STL namespace.