The Gaudi Framework  master (f31105fd)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
AuditorSvc.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #pragma once
12 
13 // Include Files
15 #include <GaudiKernel/Service.h>
16 #include <list>
17 #include <vector>
18 
19 //------------------------------------------------------------------
20 //
21 // ClassName: AuditorSvc
22 //
23 // Description: This service manages Auditors.
24 // Auditors can be inserted in the system to audit the Algorithms is
25 // in their functions.
26 //------------------------------------------------------------------
27 class AuditorSvc : public extends<Service, IAuditorSvc> {
28 public:
29  StatusCode initialize() override;
30  StatusCode finalize() override;
31 
32  // IAuditorSvc interfaces overwrite
33  //
35 
36  void before( StandardEventType, INamedInterface* ) override;
37  void before( StandardEventType, const std::string& ) override;
38 
39  void before( CustomEventTypeRef, INamedInterface* ) override;
40  void before( CustomEventTypeRef, const std::string& ) override;
41 
42  void after( StandardEventType, INamedInterface*, const StatusCode& ) override;
43  void after( StandardEventType, const std::string&, const StatusCode& ) override;
44 
45  void after( CustomEventTypeRef, INamedInterface*, const StatusCode& ) override;
46  void after( CustomEventTypeRef, const std::string&, const StatusCode& ) override;
47 
48  bool isEnabled() const override;
49 
50  StatusCode sysInitialize() override;
51  StatusCode sysFinalize() override;
52 
53  // management functionality: retrieve an Auditor
54  IAuditor* getAuditor( const std::string& name ) override;
55 
56  using extends::extends;
57 
58 private:
59  // management helper
60  SmartIF<IAuditor> newAuditor_( MsgStream&, std::string_view );
61  SmartIF<IAuditor> findAuditor_( std::string_view );
63 
65  this, "Auditors", {}, "list of auditors names", "OrderedSet<std::string>" };
66  Gaudi::Property<bool> m_isEnabled{ this, "Enable", true, "enable/disable alltogether the auditors" };
67 
68  // Manager list of Auditors
70 };
AuditorSvc::m_isEnabled
Gaudi::Property< bool > m_isEnabled
Definition: AuditorSvc.h:66
AuditorSvc::sysFinalize
StatusCode sysFinalize() override
Definition: AuditorSvc.cpp:174
AuditorSvc::after
void after(StandardEventType, INamedInterface *, const StatusCode &) override
Definition: AuditorSvc.cpp:143
std::string
STL class.
AuditorSvc::syncAuditors_
StatusCode syncAuditors_()
Definition: AuditorSvc.cpp:60
AuditorSvc::m_pAudList
std::vector< SmartIF< IAuditor > > m_pAudList
Definition: AuditorSvc.h:69
AuditorSvc::before
void before(StandardEventType, INamedInterface *) override
The following methods are meant to be implemented by the child class...
Definition: AuditorSvc.cpp:114
std::vector
STL class.
AuditorSvc::initialize
StatusCode initialize() override
Definition: AuditorSvc.cpp:91
IAuditorSvc.h
Service::name
const std::string & name() const override
Retrieve name of the service
Definition: Service.cpp:332
StatusCode
Definition: StatusCode.h:65
AuditorSvc
Definition: AuditorSvc.h:27
AuditorSvc::isEnabled
bool isEnabled() const override
Definition: AuditorSvc.cpp:171
AuditorSvc::finalize
StatusCode finalize() override
Definition: AuditorSvc.cpp:102
SmartIF< IAuditor >
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:20
MsgStream
Definition: MsgStream.h:33
AuditorSvc::newAuditor_
SmartIF< IAuditor > newAuditor_(MsgStream &, std::string_view)
Definition: AuditorSvc.cpp:32
Service.h
AuditorSvc::sysInitialize
StatusCode sysInitialize() override
Definition: AuditorSvc.cpp:173
INamedInterface
Definition: INamedInterface.h:25
AuditorSvc::m_audNameList
Gaudi::Property< std::vector< std::string > > m_audNameList
Definition: AuditorSvc.h:64
AuditorSvc::findAuditor_
SmartIF< IAuditor > findAuditor_(std::string_view)
Definition: AuditorSvc.cpp:51
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:37
IAuditor
Definition: IAuditor.h:27
AuditorSvc::getAuditor
IAuditor * getAuditor(const std::string &name) override
Definition: AuditorSvc.cpp:176