The Gaudi Framework  v29r0 (ff2e7097)
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 <string>
6 #include <vector>
7 // GaudiKernel
8 #include "GaudiKernel/Service.h"
9 // Include files
10 // GaudiGSL
11 #include "GaudiGSL/GslError.h"
12 #include "GaudiGSL/IGslSvc.h"
13 
14 // forward declarations
15 struct IGslErrorHandler; // from GaudiGSL
16 
83 class GslSvc : public extends<Service, IGslSvc>
84 {
85 public:
86  using extends::extends;
87 
89  GslSvc( const GslSvc& ) = delete;
90  GslSvc& operator=( const GslSvc& ) = delete;
91 
97  StatusCode handle( const GslError& error ) const override;
98 
103  GslErrorHandler handler() const override;
104 
110  GslErrorHandler setHandler( GslErrorHandler handler ) const override;
111 
117  StatusCode status( const int error ) const override;
118 
125  StatusCode initialize() override;
126 
133  StatusCode finalize() override;
134 
135 private:
136  Gaudi::Property<std::string> m_errorPolicy{this, "ErrorPolicy", "GSL", ""};
138  Gaudi::Property<std::vector<int>> m_ignore{this, "IgnoreCodes", {}, "codes to be ignored"};
139 
141 };
142 
143 // ============================================================================
144 // The END
145 // ============================================================================
146 #endif // GAUDIGSL_GSLSVC_H
147 // ============================================================================
Gaudi::Property< std::string > m_errorPolicy
Definition: GslSvc.h:136
Gaudi::Property< std::vector< std::string > > m_handlersTypeNames
Definition: GslSvc.h:137
Helper class to represent GSL errors.
Definition: GslError.h:16
Implementation of property with value of concrete type.
Definition: Property.h:319
The abstract interface for arbitrary GSL error handler.
Gaudi::Property< std::vector< int > > m_ignore
Definition: GslSvc.h:138
StatusCode finalize() override
standard service finalization
Definition: GslSvc.cpp:113
GslSvc & operator=(const GslSvc &)=delete
GslErrorHandler setHandler(GslErrorHandler handler) const override
set new GSL error handler
Definition: GslSvc.cpp:144
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
StatusCode initialize() override
standard service initialization
Definition: GslSvc.cpp:37
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
GslSvc(const GslSvc &)=delete
no copy constructor / assignment
The implementation of IGslSvc interface.
Definition: GslSvc.h:83
StatusCode handle(const GslError &error) const override
handle the GSL error
Definition: GslSvc.cpp:180
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
GslErrorHandler handler() const override
retrieve the current GSL error handler
Definition: GslSvc.cpp:130
std::vector< IGslErrorHandler * > m_handlers
Definition: GslSvc.h:140
StatusCode status(const int error) const override
transform GSL error code to Gaudi status code
Definition: GslSvc.cpp:161