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 extends<Service,
84  IGslSvc> {
85 public:
86 
92  StatusCode handle ( const GslError& error ) const override;
93 
98  GslErrorHandler handler () const override;
99 
105  GslErrorHandler setHandler ( GslErrorHandler handler ) const override;
106 
112  StatusCode status ( const int error ) const override;
113 
120  StatusCode initialize () override;
121 
128  StatusCode finalize () override;
129 
135  GslSvc ( const std::string& name ,
136  ISvcLocator* svc );
137 
139  ~GslSvc() override = default;
140 
141 private:
142 
144  GslSvc();
146  GslSvc ( const GslSvc& );
148  GslSvc& operator= ( const GslSvc& );
149 
150 private:
151 
154 
159  Handlers m_handlers ;
160 
163 
164 };
165 
166 // ============================================================================
167 // The END
168 // ============================================================================
169 #endif // GAUDIGSL_GSLSVC_H
170 // ============================================================================
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:162
std::vector< std::string > Names
external handlers
Definition: GslSvc.h:156
StatusCode handle(const GslError &error) const override
handle the GSL error
Definition: GslSvc.cpp:205
Names m_handlersTypeNames
Definition: GslSvc.h:157
StatusCode finalize() override
standard service finalization
Definition: GslSvc.cpp:139
STL class.
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
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:159
The implementation of IGslSvc interface.
Definition: GslSvc.h:83
std::vector< IGslErrorHandler * > Handlers
Definition: GslSvc.h:158
GslErrorHandler setHandler(GslErrorHandler handler) const override
set new GSL error handler
Definition: GslSvc.cpp:171
std::string m_errorPolicy
error policy
Definition: GslSvc.h:153
GslErrorHandler handler() const override
retrieve the current GSL error handler
Definition: GslSvc.cpp:156
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:189