1 #ifndef GAUDIKERNEL_AUDITOR_H
2 #define GAUDIKERNEL_AUDITOR_H
5 #include "GaudiKernel/IProperty.h"
6 #include "GaudiKernel/IAuditor.h"
7 #include "GaudiKernel/IService.h"
8 #include "GaudiKernel/ISvcLocator.h"
9 #include "GaudiKernel/PropertyMgr.h"
10 #include <Gaudi/PluginService.h>
61 void before(StandardEventType,
const std::string&)
override;
64 void before(CustomEventTypeRef,
const std::string&)
override;
67 void after(StandardEventType,
const std::string&,
const StatusCode&)
override;
70 void after(CustomEventTypeRef,
const std::string&,
const StatusCode&)
override;
95 const std::string&
name()
const override;
97 bool isEnabled()
const override;
108 void setOutputLevel(
int level );
120 auto ptr = serviceLocator()->service<T>(
name, createIf);
130 template <
class T = IService>
132 return serviceLocator()->service<T>(
name, createIf);
154 const std::vector<Property*>& getProperties( )
const;
199 template <
class TYPE>
242 const std::string& doc =
"none")
const {
243 return m_PropertyMgr->declareProperty(name, property, doc);
265 #ifndef GAUDI_NEW_PLUGIN_SERVICE
270 template <
typename S,
typename... Args>
272 return new T(std::forward<Args>(
args)...);
278 #define DECLARE_AUDITOR_FACTORY(x) \
279 DECLARE_FACTORY_WITH_CREATOR(x, AudFactory< x >, Auditor::Factory)
280 #define DECLARE_NAMESPACE_AUDITOR_FACTORY(n, x) \
281 DECLARE_AUDITOR_FACTORY(n::x)
286 #define DECLARE_AUDITOR_FACTORY(x) DECLARE_COMPONENT(x)
287 #define DECLARE_NAMESPACE_AUDITOR_FACTORY(n, x) DECLARE_COMPONENT(n::x)
291 #endif //GAUDIKERNEL_AUDITOR_H
StatusCode setProperty(IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
simple function to set the property of the given object from the value
bool m_isEnabled
Auditor is enabled flag.
Base class used to implement the interfaces.
StatusCode service(const std::string &name, T *&svc, bool createIf=false) const
Access a service by name, creating it if it doesn't already exist.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
SmartIF< IMessageSvc > m_MS
Message service.
GAUDI_API bool hasProperty(const IProperty *p, const std::string &name)
simple function which check the existence of the property with the given name.
const char *PyHelper() getProperty(IInterface *p, char *name)
std::string m_name
Auditor's name for identification.
implements & operator=(const implements &)
Assignment operator (do not touch the reference count).
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
bool m_isInitialized
Auditor has been initialized flag.
Gaudi::PluginService::Factory< IAuditor *, const std::string &, ISvcLocator * > Factory
SmartIF< PropertyMgr > m_PropertyMgr
For management of properties.
General service interface definition.
This class is used for returning status codes from appropriate routines.
The IMessage is the interface implemented by the message service.
bool PyHelper() setProperty(IInterface *p, char *name, char *value)
Base class from which all concrete algorithm classes should be derived.
IInterface compliant class extending IInterface with the name() method.
Property base class allowing Property* collections to be "homogeneous".
Class wrapping the signature for a factory with any number of arguments.
static S::ReturnType create(Args &&...args)
int outputLevel() const
Retrieve the output level of current auditor.
The IAuditor is the interface implmented by the AlgAuditor base class.
SmartIF< T > service(const std::string &name, bool createIf=false) const
int m_outputLevel
Auditor output level.
Base class from which all concrete auditor classes should be derived.
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
bool m_isFinalized
Auditor has been finalized flag.