All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GslSvc Class Reference

The implementation of IGslSvc interface. More...

#include <src/Components/GslSvc.h>

Inheritance diagram for GslSvc:
Collaboration diagram for GslSvc:

Public Member Functions

virtual StatusCode handle (const GslError &error) const
 handle the GSL error More...
 
virtual GslErrorHandler handler () const
 retrieve the current GSL error handler More...
 
virtual GslErrorHandler setHandler (GslErrorHandler handler) const
 set new GSL error handler More...
 
virtual StatusCode status (const int error) const
 transform GSL error code to Gaudi status code More...
 
virtual StatusCode initialize ()
 standard service initialization More...
 
virtual StatusCode finalize ()
 standard service finalization More...
 
 GslSvc (const std::string &name, ISvcLocator *svc)
 Standard constructor. More...
 
virtual ~GslSvc ()
 destructor, virtual and protected More...
 
- Public Member Functions inherited from extends1< Service, IGslSvc >
 extends1 (A1 a1, A2 a2, A3 a3)
 Templated constructor with 3 arguments. More...
 
 extends1 (A1 a1, A2 a2)
 Templated constructor with 2 arguments. More...
 
 extends1 (A1 a1)
 Templated constructor with 1 argument. More...
 
 extends1 ()
 Default constructor. More...
 
virtual void * i_cast (const InterfaceID &tid) const
 Implementation of IInterface::i_cast. More...
 
virtual StatusCode queryInterface (const InterfaceID &ti, void **pp)
 Implementation of IInterface::queryInterface. More...
 
virtual std::vector< std::string > getInterfaceNames () const
 Implementation of IInterface::getInterfaceNames. More...
 
virtual ~extends1 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from Service
virtual unsigned long release ()
 Release Interface instance. More...
 
virtual const std::string & name () const
 Retrieve name of the service. More...
 
virtual StatusCode configure ()
 Configuration (from OFFLINE to CONFIGURED). More...
 
virtual StatusCode start ()
 Start (from INITIALIZED to RUNNING). More...
 
virtual StatusCode stop ()
 Stop (from RUNNING to INITIALIZED). More...
 
virtual StatusCode terminate ()
 Initialization (from CONFIGURED to OFFLINE). More...
 
virtual Gaudi::StateMachine::State FSMState () const
 Get the current state. More...
 
virtual Gaudi::StateMachine::State targetFSMState () const
 When we are in the middle of a transition, get the state where the transition is leading us. More...
 
virtual StatusCode reinitialize ()
 Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED). More...
 
virtual StatusCode restart ()
 Initialization (from RUNNING to RUNNING, via INITIALIZED). More...
 
virtual StatusCode sysInitialize ()
 Initialize Service. More...
 
virtual StatusCode sysStart ()
 Initialize Service. More...
 
virtual StatusCode sysStop ()
 Initialize Service. More...
 
virtual StatusCode sysFinalize ()
 Finalize Service. More...
 
virtual StatusCode sysReinitialize ()
 Re-initialize the Service. More...
 
virtual StatusCode sysRestart ()
 Re-initialize the Service. More...
 
virtual StatusCode setProperty (const Property &p)
 Set the property by property. More...
 
virtual StatusCode setProperty (const std::string &s)
 Set the property by string. More...
 
virtual StatusCode setProperty (const std::string &n, const std::string &v)
 Set the property by std::string. More...
 
virtual StatusCode getProperty (Property *p) const
 Get the property by property. More...
 
virtual const PropertygetProperty (const std::string &name) const
 Get the property by name. More...
 
virtual StatusCode getProperty (const std::string &n, std::string &v) const
 Get the property by std::string. More...
 
virtual const std::vector
< Property * > & 
getProperties () const
 Get list of properties. More...
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
 Service (const std::string &name, ISvcLocator *svcloc)
 Standard Constructor. More...
 
SmartIF< ISvcLocator > & serviceLocator () const
 Retrieve pointer to service locator. More...
 
StatusCode setProperties ()
 Method for setting declared properties to the values specified for the job. More...
 
template<class T >
StatusCode service (const std::string &name, const T *&psvc, bool createIf=true) const
 Access a service by name, creating it if it doesn't already exist. More...
 
template<class T >
StatusCode service (const std::string &name, T *&psvc, bool createIf=true) const
 
template<class T >
StatusCode service (const std::string &svcType, const std::string &svcName, T *&psvc) const
 Access a service by name and type, creating it if it doesn't already exist. More...
 
template<class T >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property. More...
 
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
 Declare remote named properties. More...
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
 
- Public Member Functions inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
 CommonMessaging (const A1 &a1, const A2 &a2, const A3 &a3)
 Templated constructor with 3 arguments. More...
 
 CommonMessaging (const A1 &a1, const A2 &a2)
 Templated constructor with 2 arguments. More...
 
 CommonMessaging (const A1 &a1)
 Templated constructor with 1 argument. More...
 
 CommonMessaging ()
 Default constructor. More...
 
virtual ~CommonMessaging ()
 Virtual destructor. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream. More...
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts. More...
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS) More...
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL) More...
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING) More...
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG) More...
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE) More...
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MSG::Level msgLevel () const
 get the output level from the embedded MsgStream More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 
- Public Member Functions inherited from extend_interfaces3< IService, IProperty, IStateful >
virtual ~extend_interfaces3 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IService
 DeclareInterfaceID (IService, 3, 0)
 InterfaceID. More...
 
virtual ~IService ()
 virtual destructor More...
 
- Public Member Functions inherited from INamedInterface
 DeclareInterfaceID (INamedInterface, 1, 0)
 InterfaceID. More...
 
virtual ~INamedInterface ()
 Virtual destructor (always needed for abstract classes). More...
 
- Public Member Functions inherited from IInterface
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance. More...
 
virtual unsigned long refCount () const =0
 Current reference count. More...
 
virtual ~IInterface ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IProperty
 DeclareInterfaceID (IProperty, 2, 0)
 InterfaceID. More...
 
- Public Member Functions inherited from IStateful
 DeclareInterfaceID (IStateful, 1, 0)
 InterfaceID. More...
 
virtual ~IStateful ()
 
- Public Member Functions inherited from extend_interfaces1< IGslSvc >
virtual ~extend_interfaces1 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IGslSvc
 DeclareInterfaceID (IGslSvc, 2, 0)
 InterfaceID. More...
 

Private Types

typedef std::vector< std::string > Names
 external handlers More...
 
typedef std::vector
< IGslErrorHandler * > 
Handlers
 

Private Member Functions

 GslSvc ()
 default constructor is private More...
 
 GslSvc (const GslSvc &)
 copy constructor is private More...
 
GslSvcoperator= (const GslSvc &)
 assignment operator is private More...
 

Private Attributes

std::string m_errorPolicy
 error policy More...
 
Names m_handlersTypeNames
 
Handlers m_handlers
 
std::vector< int > m_ignore
 codes to be ignored More...
 

Additional Inherited Members

- Public Types inherited from extends1< Service, IGslSvc >
typedef extends1 base_class
 Typedef to this class. More...
 
typedef extend_interfaces1
< IGslSvc
extend_interfaces_base
 Typedef to the base of this class. More...
 
typedef
extend_interfaces_base::ext_iids 
interfaces
 MPL set of all the implemented interfaces. More...
 
- Public Types inherited from Service
typedef
Gaudi::PluginService::Factory
< IService *, const
std::string &, ISvcLocator * > 
Factory
 
- Public Types inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
typedef CommonMessaging base_class
 
- Public Types inherited from implements3< IService, IProperty, IStateful >
typedef implements3 base_class
 Typedef to this class. More...
 
typedef extend_interfaces3
< IService, IProperty,
IStateful
extend_interfaces_base
 Typedef to the base of this class. More...
 
typedef
extend_interfaces_base::ext_iids 
interfaces
 MPL set of all the implemented interfaces. More...
 
- Public Types inherited from extend_interfaces3< IService, IProperty, IStateful >
typedef mpl::fold< typename
IService::iid::iids::type,
typename mpl::fold< typename
IProperty::iid::iids::type,
typename
IStateful::iid::iids::type,
mpl::insert< mpl::_1, mpl::_2 >
>::type, mpl::insert< mpl::_1,
mpl::_2 > >::type 
ext_iids
 MPL set of interfaces extended by this one. More...
 
- Public Types inherited from IInterface
enum  Status { SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR }
 Return status. More...
 
typedef Gaudi::InterfaceId
< IInterface, 0, 0 > 
iid
 Interface ID. More...
 
typedef mpl::set1< iidext_iids
 Extra interfaces. More...
 
- Public Types inherited from extend_interfaces1< IGslSvc >
typedef IGslSvc::iid::iids::type ext_iids
 MPL set of interfaces extended by this one. More...
 
- Public Types inherited from IGslSvc
typedef void(* GslErrorHandler )(const char *, const char *, int, int)
 type definition of "standard" GSL error handler functions More...
 
- Static Public Member Functions inherited from IInterface
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface. More...
 
- Protected Member Functions inherited from Service
virtual ~Service ()
 Standard Destructor. More...
 
int outputLevel () const
 get the Service's output level More...
 
- Protected Member Functions inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 
- Protected Member Functions inherited from IGslSvc
virtual ~IGslSvc ()
 destructor (virtual and protected) More...
 
- Protected Attributes inherited from Service
IntegerProperty m_outputLevel
 Service output level. More...
 
Gaudi::StateMachine::State m_state
 Service state. More...
 
Gaudi::StateMachine::State m_targetState
 Service state. More...
 
- Protected Attributes inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
SmartIF< IMessageSvcm_msgsvc
 Pointer to the message service;. More...
 
std::auto_ptr< MsgStreamm_msgStream
 The predefined message stream. More...
 
bool m_streamWithService
 Flag to create a new MsgStream if it was created without the message service. More...
 

Detailed Description

The implementation of IGslSvc interface.

The Gsl Service is teh service which perform intelligent error handling for GSL (GNU Scientific Library)

It provides a choice between different "Error Handling Policies"

Current implementation supports the several "error handling policies", which are driven by "ErrorPolicy" property of class GslSvc:

  • "GSL": The simplest error policy, no action, the error hadling defined in GSL does not redefined
  • "Off": The GSL empty error handling is used, what means the ignorance of all GSL errors. Program continues after any error, so the return values from any library routines must be checked. This policy is recommended by GSL team for production programs
  • "Abort" The default GSL error policy, causes abort on error.
  • "Ignore" The policy which is essentially the same as "Off", but performed with local error handler GslErrorHandlers::ignoreTheError
  • "Exception" This policy throws the GaudiException with tag *GSL Error" to be thrown at the error. The policy implemented by local error handler GslErrorHandlers::throwException
  • "Handle" The policy which uses the call back from local error handler GslErrorHandlers::handleTheError to IGslSvc::handle method. Current implementation of this method is sequential execution of declared handlers, defined through the property "Handlers" of class GslSvc in a format: GslSvc.Handlers = { "H1Type/H1Name" , "H2Type/H2Name" , "H3ype/3Name" }; The "handlers" must implement IGslErrorHandler interface The concrete handlers are provided in GaudiGSL package: class GslErorCount, GslErrorPrint and GslErrorException.
Attention
The error handling could be "turned off" for selected error codes (e.g. GSL_SUCCESS or GSL_CONTINUE ) using "IgnoreCodes" property. This feature is active only for "Handle" error policy.
See also
GslErrorHandlers
GslErrorHandlers::ingnoreTheError
GslErrorHandlers::throwException
GslErrorHandlers::handleTheError
IGslSvc
IGslErrorHandler
GslErrorCount
GslErrorPrint
GslErrorException
Author
Vanya Belyaev Ivan..nosp@m.Bely.nosp@m.aev@i.nosp@m.tep..nosp@m.ru
Date
29/04/2002

Definition at line 85 of file GslSvc.h.

Member Typedef Documentation

typedef std::vector<IGslErrorHandler*> GslSvc::Handlers
private

Definition at line 159 of file GslSvc.h.

typedef std::vector<std::string> GslSvc::Names
private

external handlers

Definition at line 157 of file GslSvc.h.

Constructor & Destructor Documentation

GslSvc::GslSvc ( const std::string &  name,
ISvcLocator svc 
)

Standard constructor.

See also
Service
Parameters
nameservice name
scvpointer to service locator
nameservice name
scvpointer to service locator

Definition at line 38 of file GslSvc.cpp.

40  : base_class ( name , svc )
41  , m_errorPolicy ( "GSL" )
43  , m_handlers ()
44  , m_ignore ()
45 {
46  declareProperty( "ErrorPolicy" , m_errorPolicy ) ;
47  declareProperty( "Handlers" , m_handlersTypeNames ) ;
48  declareProperty( "IgnoreCodes" , m_ignore ) ;
49 }
std::vector< int > m_ignore
codes to be ignored
Definition: GslSvc.h:163
Names m_handlersTypeNames
Definition: GslSvc.h:158
extends1 base_class
Typedef to this class.
Definition: extends.h:12
Handlers m_handlers
Definition: GslSvc.h:160
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
std::string m_errorPolicy
error policy
Definition: GslSvc.h:154
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Service.h:211
GslSvc::~GslSvc ( )
virtual

destructor, virtual and protected

destructor

Definition at line 55 of file GslSvc.cpp.

55 {}
GslSvc::GslSvc ( )
private

default constructor is private

GslSvc::GslSvc ( const GslSvc )
private

copy constructor is private

Member Function Documentation

StatusCode GslSvc::finalize ( )
virtual

standard service finalization

See also
Service
IGslSvc
IService
Returns
status code
See also
Service
IService
Returns
status code

Reimplemented from Service.

Definition at line 154 of file GslSvc.cpp.

155 {
156  MsgStream log(msgSvc(), name());
157  log << MSG::DEBUG << "==> Finalize" << endmsg;
158 
159  // deactivate the static accessor to the service
160  GaudiGSL::setGslSvc( 0 );
161 
162  // finalize the base class
163  return Service::finalize() ;
164 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
static const IGslSvc * setGslSvc(const IGslSvc *value)
set new value for static Gaudi GSL Service
Definition: GaudiGSL.cpp:38
virtual StatusCode finalize()
Finalize (from INITIALIZED to CONFIGURED).
Definition: Service.cpp:199
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode GslSvc::handle ( const GslError error) const
virtual

handle the GSL error

See also
IGslSvc
Parameters
errerror
Returns
status code
Parameters
errorerror
Returns
status code

Implements IGslSvc.

Definition at line 223 of file GslSvc.cpp.

224 {
226  // code to be ignored?
227  if( m_ignore.end() != std::find( m_ignore.begin () ,
228  m_ignore.end () ,
229  error.code ) ) { return sc ; }
230  // invoke all handlers
231  for( Handlers::const_iterator handler = m_handlers.begin() ;
232  sc.isSuccess() && m_handlers.end() != handler ; ++handler )
233  { sc = (*handler)->handle( error ); }
234  //
235  return sc ;
236 }
std::vector< int > m_ignore
codes to be ignored
Definition: GslSvc.h:163
int code
error code (GSL)
Definition: GslError.h:27
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:62
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
Handlers m_handlers
Definition: GslSvc.h:160
IGslSvc::GslErrorHandler GslSvc::handler ( ) const
virtual

retrieve the current GSL error handler

See also
IGslSvc
Returns
current GSL error handler
current GSL error handler

Implements IGslSvc.

Definition at line 172 of file GslSvc.cpp.

173 {
174  GslErrorHandler hh = gsl_set_error_handler( 0 );
175  gsl_set_error_handler( hh );
176  return hh ;
177 }
void(* GslErrorHandler)(const char *, const char *, int, int)
type definition of "standard" GSL error handler functions
Definition: IGslSvc.h:30
StatusCode GslSvc::initialize ( )
virtual

standard service initialization

See also
Service
IGslSvc
IService
Returns
status code
See also
Service
IService
Returns
status code

Prints the type of used handler get the handler

Get Tool Service

Reimplemented from Service.

Definition at line 65 of file GslSvc.cpp.

66 {
67  // initialize the base class
69  MsgStream log( msgSvc() , name() );
70  if( sc.isFailure() )
71  { log << MSG::ERROR
72  << " Error in initialization of base class 'Service'"<< endmsg;
73  return sc;
74  }
75  // activate the static accessor to the service
76  GaudiGSL::setGslSvc( this );
77  // set the error handlers
78  if ( "GSL" == m_errorPolicy ) { /* nothing to do */ }
79  else if ( "Off" == m_errorPolicy )
80  { gsl_set_error_handler_off() ; }
81  else if ( "Abort" == m_errorPolicy )
82  { gsl_set_error_handler ( 0 ) ; }
83  else if ( "Ignore" == m_errorPolicy )
84  { gsl_set_error_handler ( GslErrorHandlers::ignoreTheError ) ; }
85  else if ( "Exception" == m_errorPolicy )
86  { gsl_set_error_handler ( GslErrorHandlers::throwException ) ; }
87  else if ( "Handle" == m_errorPolicy )
88  { gsl_set_error_handler ( GslErrorHandlers::handleTheError ) ; }
89  else
90  { log << MSG::ERROR
91  << " Unknown Error policy '" << m_errorPolicy << "'"
92  << " Valid policies: "
93  << "[ 'GSL' , 'Off' , 'Abort' , 'Ignore' , 'Exception' , 'Handle' ]"
94  << endmsg;
95  return StatusCode::FAILURE ;
96  }
99  GslErrorHandler handler = gsl_set_error_handler( 0 );
100  gsl_set_error_handler( handler );
101  if( 0 != handler )
102  { log << MSG::VERBOSE
103  << " GSL Error Handler is '"
104  << System::typeinfoName( typeid(*handler) ) << "'"
105  << endmsg; }
106  else { log << MSG::INFO << " Error Handler is NULL" << endmsg ; }
107 
108  if( !m_handlersTypeNames.empty() )
109  {
111  SmartIF<IToolSvc> toolsvc(serviceLocator()->service("ToolSvc"));
112  if (!toolsvc.isValid()) {
113  log << MSG::ERROR << " Could not locate Tool Service! " << endmsg;
114  return StatusCode::FAILURE;
115  }
116  for( Names::const_iterator it = m_handlersTypeNames.begin() ;
117  m_handlersTypeNames.end() != it ; ++it )
118  {
119  std::string::const_iterator ipos =
120  std::find( it->begin() , it->end() , '/');
121  const std::string::size_type pos = ipos - it->begin() ;
122  IGslErrorHandler* eh = 0 ;
123  if( it->end() != ipos )
124  { sc = toolsvc->retrieveTool
125  ( std::string( *it , 0 , pos ) ,
126  std::string( *it , pos + 1, it->length() ), eh , this ) ; }
127  else
128  { sc = toolsvc->retrieveTool
129  ( *it , std::string( *it , pos + 1, it->length() ) ,
130  eh , this ) ; }
131  if( sc.isFailure() )
132  { log << MSG::ERROR
133  << " Could not retrieve tool '" << *it << "'"<< endmsg ;
134  return sc ; }
135  if( 0 == eh )
136  { log << MSG::ERROR
137  << " Could not retrieve tool '" << *it << "'"<< endmsg ;
138  return StatusCode::FAILURE ; }
139  m_handlers.push_back( eh );
140  }
141  }
142  //
143  return StatusCode::SUCCESS;
144 }
The abstract interface for arbitrary GSL error handler.
GAUDI_API void handleTheError(const char *reason, const char *file, int line, int code)
The simplest Gsl Error handler, It delegates the actual error handling to GSL Service.
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:298
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Names m_handlersTypeNames
Definition: GslSvc.h:158
GAUDI_API void throwException(const char *reason, const char *file, int line, int code)
The simple Gsl Error handler, it throwns the Gaudi Exception.
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:72
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
Handlers m_handlers
Definition: GslSvc.h:160
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
std::string m_errorPolicy
error policy
Definition: GslSvc.h:154
virtual StatusCode initialize()
Initialization (from CONFIGURED to INITIALIZED).
Definition: Service.cpp:74
static const IGslSvc * setGslSvc(const IGslSvc *value)
set new value for static Gaudi GSL Service
Definition: GaudiGSL.cpp:38
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Service.h:142
GAUDI_API void ignoreTheError(const char *reason, const char *file, int line, int code)
The simplest Gsl Error handler, It simply ingnores the error.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.
Definition: Service.cpp:336
GslSvc& GslSvc::operator= ( const GslSvc )
private

assignment operator is private

IGslSvc::GslErrorHandler GslSvc::setHandler ( IGslSvc::GslErrorHandler  handler) const
virtual

set new GSL error handler

See also
IGslSvc
Parameters
handlernew GSL error handler
Returns
GSL error handler
Parameters
handlernew GSL error handler
Returns
GSL error handler

Implements IGslSvc.

Definition at line 187 of file GslSvc.cpp.

188 {
189  gsl_set_error_handler( handler );
190  {
191  MsgStream log( msgSvc(), name() );
192  log << MSG::DEBUG << " New GSL handler is set '" ;
193  if( 0 == handler ) { log << "NULL" ; }
194  else { log << System::typeinfoName( typeid(handler) ) ; }
195  log << "'" << endmsg ;
196  }
197  return handler ;
198 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:298
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
virtual GslErrorHandler handler() const
retrieve the current GSL error handler
Definition: GslSvc.cpp:172
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode GslSvc::status ( const int  error) const
virtual

transform GSL error code to Gaudi status code

See also
IGslSvc
Parameters
errorGLS error code
Returns
status code
Parameters
errorGLS error code
Returns
status code

Implements IGslSvc.

Definition at line 207 of file GslSvc.cpp.

208 {
209  if( GSL_SUCCESS == error ){ return StatusCode::SUCCESS ; }
210  StatusCode sc( error );
211  if( sc.isSuccess() ){ return StatusCode::FAILURE ; }
212  return sc ;
213 }
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)

Member Data Documentation

std::string GslSvc::m_errorPolicy
private

error policy

Definition at line 154 of file GslSvc.h.

Handlers GslSvc::m_handlers
private

Definition at line 160 of file GslSvc.h.

Names GslSvc::m_handlersTypeNames
private

Definition at line 158 of file GslSvc.h.

std::vector<int> GslSvc::m_ignore
private

codes to be ignored

Definition at line 163 of file GslSvc.h.


The documentation for this class was generated from the following files: