GslSvc.h
Go to the documentation of this file.
1 #ifndef GAUDIGSL_GSLSVC_H
2 #define GAUDIGSL_GSLSVC_H 1
3 // Include files
4 // STD & STL
5 #include <vector>
6 #include <string>
7 // GaudiKernel
8 #include "GaudiKernel/Service.h"
9 // Include files
10 // GaudiGSL
11 #include "GaudiGSL/IGslSvc.h"
12 #include "GaudiGSL/GslError.h"
13 
14 // forward declarations
15 class IGslErrorHandler ; // from GaudiGSL
16 
83 class GslSvc: public extends1<Service, IGslSvc> {
84 public:
85 
91  StatusCode handle ( const GslError& error ) const override;
92 
97  GslErrorHandler handler () const override;
98 
104  GslErrorHandler setHandler ( GslErrorHandler handler ) const override;
105 
111  StatusCode status ( const int error ) const override;
112 
119  StatusCode initialize () override;
120 
127  StatusCode finalize () override;
128 
134  GslSvc ( const std::string& name ,
135  ISvcLocator* svc );
136 
138  ~GslSvc() override = default;
139 
140 private:
141 
143  GslSvc();
145  GslSvc ( const GslSvc& );
147  GslSvc& operator= ( const GslSvc& );
148 
149 private:
150 
152  std::string m_errorPolicy = "GSL" ;
153 
155  typedef std::vector<std::string> Names ;
157  typedef std::vector<IGslErrorHandler*> Handlers ;
158  Handlers m_handlers ;
159 
161  std::vector<int> m_ignore ;
162 
163 };
164 
165 // ============================================================================
166 // The END
167 // ============================================================================
168 #endif // GAUDIGSL_GSLSVC_H
169 // ============================================================================
The abstract interface for arbitrary GSL error handler.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
Helper class to represent GSL errors.
Definition: GslError.h:15
std::vector< int > m_ignore
codes to be ignored
Definition: GslSvc.h:161
std::vector< std::string > Names
external handlers
Definition: GslSvc.h:155
StatusCode handle(const GslError &error) const override
handle the GSL error
Definition: GslSvc.cpp:209
Names m_handlersTypeNames
Definition: GslSvc.h:156
StatusCode finalize() override
standard service finalization
Definition: GslSvc.cpp:140
StatusCode initialize() override
standard service initialization
Definition: GslSvc.cpp:56
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
GslSvc & operator=(const GslSvc &)
assignment operator is private
Handlers m_handlers
Definition: GslSvc.h:158
The implementation of IGslSvc interface.
Definition: GslSvc.h:83
std::vector< IGslErrorHandler * > Handlers
Definition: GslSvc.h:157
GslErrorHandler setHandler(GslErrorHandler handler) const override
set new GSL error handler
Definition: GslSvc.cpp:173
std::string m_errorPolicy
error policy
Definition: GslSvc.h:152
GslErrorHandler handler() const override
retrieve the current GSL error handler
Definition: GslSvc.cpp:158
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
~GslSvc() override=default
destructor, virtual and protected
GslSvc()
default constructor is private
StatusCode status(const int error) const override
transform GSL error code to Gaudi status code
Definition: GslSvc.cpp:193