| The Gaudi Framework v32r1 (f65d50dc)

StatusCodeSvc.h
Go to the documentation of this file.
1 #ifndef GAUDISVC_STATUSCODESVC_H
2 #define GAUDISVC_STATUSCODESVC_H
3
4 #include "GaudiKernel/IStatusCodeSvc.h"
5 #include "GaudiKernel/Service.h"
6
7 #include "tbb/concurrent_unordered_map.h"
8
9 #include <set>
10 #include <string>
11
12 class StatusCodeSvc : public extends<Service, IStatusCodeSvc> {
13 public:
14 using extends::extends;
15 StatusCode initialize() override;
16 StatusCode reinitialize() override;
17 StatusCode finalize() override;
18
19 void regFnc( const std::string& func, const std::string& lib ) override;
20 void list() const override;
21 bool suppressCheck() const override { return m_suppress.value(); }
22
23 private:
24 struct StatCodeDat final {
25 // the atomic forces us to define these otherwise trivial constructors:
26 StatCodeDat( const std::string f, const std::string l ) : fnc( f ), lib( l ) {}
27 StatCodeDat( StatCodeDat&& o ) : fnc( o.fnc ), lib( o.lib ), count( o.count.load() ) {}
28 StatCodeDat( const StatCodeDat& o ) : fnc( o.fnc ), lib( o.lib ), count( o.count.load() ) {}
29 std::string fnc;
30 std::string lib;
31 std::atomic<unsigned int> count{1};
32 };
33
34 void parseFilter( const std::string& str, std::string& fnc, std::string& lib ) const;
35 bool failsFilter( const std::string& fnc, const std::string& lib ) const;
36
37 Gaudi::Property<std::vector<std::string>> m_pFilter{this, "Filter"};
38 Gaudi::Property<bool> m_abort{this, "AbortOnError", false};
39 Gaudi::Property<bool> m_suppress{this, "SuppressCheck", false};
40 Gaudi::Property<bool> m_dict{this, "IgnoreDicts", true};
41
42 tbb::concurrent_unordered_map<std::string, StatCodeDat> m_dat;
43 std::set<std::string> m_filterfnc, m_filterlib;
44 };
45
46 #endif
StatusCodeSvc::StatCodeDat::count
std::atomic< unsigned int > count
Definition: StatusCodeSvc.h:31
std::atomic< unsigned int >
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:352
StatusCodeSvc::m_dict
Gaudi::Property< bool > m_dict
Definition: StatusCodeSvc.h:40
StatusCodeSvc::StatCodeDat::fnc
std::string fnc
Definition: StatusCodeSvc.h:29
StatusCodeSvc::StatCodeDat::StatCodeDat
StatCodeDat(StatCodeDat &&o)
Definition: StatusCodeSvc.h:27
StatusCodeSvc::reinitialize
StatusCode reinitialize() override
Definition: StatusCodeSvc.cpp:30
StatusCodeSvc::list
void list() const override
Definition: StatusCodeSvc.cpp:99
StatusCodeSvc::failsFilter
bool failsFilter(const std::string &fnc, const std::string &lib) const
Definition: StatusCodeSvc.cpp:93
StatusCodeSvc::StatCodeDat::StatCodeDat
StatCodeDat(const std::string f, const std::string l)
Definition: StatusCodeSvc.h:26
StatusCodeSvc::StatCodeDat::lib
std::string lib
Definition: StatusCodeSvc.h:30
IStatusCodeSvc.h
std::string
STL class.
StatusCodeSvc::initialize
StatusCode initialize() override
Definition: StatusCodeSvc.cpp:11
Service.h
GaudiPluginService.cpluginsvc.func
func
Definition: cpluginsvc.py:211
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCodeSvc::StatCodeDat::StatCodeDat
StatCodeDat(const StatCodeDat &o)
Definition: StatusCodeSvc.h:28
StatusCodeSvc::suppressCheck
bool suppressCheck() const override
Definition: StatusCodeSvc.h:21
StatusCodeSvc::m_filterfnc
std::set< std::string > m_filterfnc
Definition: StatusCodeSvc.h:43
StatusCodeSvc::parseFilter
void parseFilter(const std::string &str, std::string &fnc, std::string &lib) const
Definition: StatusCodeSvc.cpp:141
StatusCodeSvc::regFnc
void regFnc(const std::string &func, const std::string &lib) override
Definition: StatusCodeSvc.cpp:46
gaudirun.l
dictionary l
Definition: gaudirun.py:521
StatusCodeSvc::m_dat
tbb::concurrent_unordered_map< std::string, StatCodeDat > m_dat
Definition: StatusCodeSvc.h:42
StatusCodeSvc::m_abort
Gaudi::Property< bool > m_abort
Definition: StatusCodeSvc.h:38
std::set< std::string >
StatusCodeSvc::m_suppress
Gaudi::Property< bool > m_suppress
Definition: StatusCodeSvc.h:39
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
StatusCodeSvc::m_pFilter
Gaudi::Property< std::vector< std::string > > m_pFilter
Definition: StatusCodeSvc.h:37
StatusCodeSvc
Definition: StatusCodeSvc.h:12
StatusCodeSvc::StatCodeDat
Definition: StatusCodeSvc.h:24
StatusCodeSvc::finalize
StatusCode finalize() override
Definition: StatusCodeSvc.cpp:38
StatusCodeSvc::m_filterlib
std::set< std::string > m_filterlib
Definition: StatusCodeSvc.h:43