All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GslSvc.h
Go to the documentation of this file.
1 // $Id: GslSvc.h,v 1.2 2006/11/30 10:40:53 mato Exp $
2 // ============================================================================
3 #ifndef GAUDIGSL_GSLSVC_H
4 #define GAUDIGSL_GSLSVC_H 1
5 // Include files
6 // STD & STL
7 #include <vector>
8 #include <string>
9 // GaudiKernel
10 #include "GaudiKernel/Service.h"
11 // Include files
12 // GaudiGSL
13 #include "GaudiGSL/IGslSvc.h"
14 #include "GaudiGSL/GslError.h"
15 
16 // forward declarations
17 class IGslErrorHandler ; // from GaudiGSL
18 
85 class GslSvc: public extends1<Service, IGslSvc> {
86 public:
87 
93  virtual StatusCode handle ( const GslError& error ) const ;
94 
99  virtual GslErrorHandler handler () const ;
100 
106  virtual GslErrorHandler setHandler ( GslErrorHandler handler ) const ;
107 
113  virtual StatusCode status ( const int error ) const ;
114 
121  virtual StatusCode initialize () ;
122 
129  virtual StatusCode finalize () ;
130 
136  GslSvc ( const std::string& name ,
137  ISvcLocator* svc );
138 
140  virtual ~GslSvc() ;
141 
142 private:
143 
145  GslSvc();
147  GslSvc ( const GslSvc& );
149  GslSvc& operator= ( const GslSvc& );
150 
151 private:
152 
154  std::string m_errorPolicy ;
155 
157  typedef std::vector<std::string> Names ;
159  typedef std::vector<IGslErrorHandler*> Handlers ;
161 
163  std::vector<int> m_ignore ;
164 
165 };
166 
167 // ============================================================================
168 // The END
169 // ============================================================================
170 #endif // GAUDIGSL_GSLSVC_H
171 // ============================================================================
The abstract interface for arbitrary GSL error handler.
virtual StatusCode handle(const GslError &error) const
handle the GSL error
Definition: GslSvc.cpp:223
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:26
Helper class to represent GSL errors.
Definition: GslError.h:17
std::vector< int > m_ignore
codes to be ignored
Definition: GslSvc.h:163
std::vector< std::string > Names
external handlers
Definition: GslSvc.h:157
virtual StatusCode initialize()
standard service initialization
Definition: GslSvc.cpp:65
Names m_handlersTypeNames
Definition: GslSvc.h:158
virtual ~GslSvc()
destructor, virtual and protected
Definition: GslSvc.cpp:55
void(* GslErrorHandler)(const char *, const char *, int, int)
type definition of "standard" GSL error handler functions
Definition: IGslSvc.h:30
virtual GslErrorHandler handler() const
retrieve the current GSL error handler
Definition: GslSvc.cpp:172
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
GslSvc & operator=(const GslSvc &)
assignment operator is private
Handlers m_handlers
Definition: GslSvc.h:160
The implementation of IGslSvc interface.
Definition: GslSvc.h:85
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
std::vector< IGslErrorHandler * > Handlers
Definition: GslSvc.h:159
std::string m_errorPolicy
error policy
Definition: GslSvc.h:154
virtual GslErrorHandler setHandler(GslErrorHandler handler) const
set new GSL error handler
Definition: GslSvc.cpp:187
GslSvc()
default constructor is private
virtual StatusCode finalize()
standard service finalization
Definition: GslSvc.cpp:154
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
virtual StatusCode status(const int error) const
transform GSL error code to Gaudi status code
Definition: GslSvc.cpp:207