The Gaudi Framework  v28r3 (cc1cf868)
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 
87  using extends::extends;
88 
90  GslSvc( const GslSvc& ) = delete;
91  GslSvc& operator=( const GslSvc& ) = delete;
92 
98  StatusCode handle( const GslError& error ) const override;
99 
104  GslErrorHandler handler() const override;
105 
111  GslErrorHandler setHandler( GslErrorHandler handler ) const override;
112 
118  StatusCode status( const int error ) const override;
119 
126  StatusCode initialize() override;
127 
134  StatusCode finalize() override;
135 
136 private:
137  Gaudi::Property<std::string> m_errorPolicy{this, "ErrorPolicy", "GSL", ""};
139  Gaudi::Property<std::vector<int>> m_ignore{this, "IgnoreCodes", {}, "codes to be ignored"};
140 
142 };
143 
144 // ============================================================================
145 // The END
146 // ============================================================================
147 #endif // GAUDIGSL_GSLSVC_H
148 // ============================================================================
Gaudi::Property< std::string > m_errorPolicy
Definition: GslSvc.h:137
Gaudi::Property< std::vector< std::string > > m_handlersTypeNames
Definition: GslSvc.h:138
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:139
StatusCode finalize() override
standard service finalization
Definition: GslSvc.cpp:120
GslSvc & operator=(const GslSvc &)=delete
GslErrorHandler setHandler(GslErrorHandler handler) const override
set new GSL error handler
Definition: GslSvc.cpp:152
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:26
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:186
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:137
std::vector< IGslErrorHandler * > m_handlers
Definition: GslSvc.h:141
StatusCode status(const int error) const override
transform GSL error code to Gaudi status code
Definition: GslSvc.cpp:170