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  virtual StatusCode handle ( const GslError& error ) const ;
92 
97  virtual GslErrorHandler handler () const ;
98 
104  virtual GslErrorHandler setHandler ( GslErrorHandler handler ) const ;
105 
111  virtual StatusCode status ( const int error ) const ;
112 
119  virtual StatusCode initialize () ;
120 
127  virtual StatusCode finalize () ;
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.
virtual StatusCode handle(const GslError &error) const
handle the GSL error
Definition: GslSvc.cpp:209
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
virtual StatusCode initialize()
standard service initialization
Definition: GslSvc.cpp:56
Names m_handlersTypeNames
Definition: GslSvc.h:156
virtual GslErrorHandler handler() const
retrieve the current GSL error handler
Definition: GslSvc.cpp:158
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
std::string m_errorPolicy
error policy
Definition: GslSvc.h:152
virtual GslErrorHandler setHandler(GslErrorHandler handler) const
set new GSL error handler
Definition: GslSvc.cpp:173
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
virtual StatusCode finalize()
standard service finalization
Definition: GslSvc.cpp:140
virtual StatusCode status(const int error) const
transform GSL error code to Gaudi status code
Definition: GslSvc.cpp:193