The Gaudi Framework  v30r3 (a5ef0a68)
IErrorTool.h
Go to the documentation of this file.
1 #ifndef GAUDIALG_IERRORTOOL_H
2 #define GAUDIALG_IERRORTOOL_H 1
3 // ============================================================================
4 // Include files
5 // ============================================================================
6 // STD & STL
7 // ============================================================================
8 #include <string>
9 // ============================================================================
10 // GaudiKernel
11 // ============================================================================
12 #include "GaudiKernel/IAlgTool.h"
14 #include "GaudiKernel/StatusCode.h"
15 // ============================================================================
16 class GaudiException;
17 
24 class GAUDI_API IErrorTool : virtual public IAlgTool
25 {
26 public:
29 
30 public:
52  virtual StatusCode Error( const std::string& msg, const StatusCode st = StatusCode::FAILURE,
53  const size_t mx = 10 ) const = 0;
54 
65  virtual StatusCode Warning( const std::string& msg, const StatusCode st = StatusCode::FAILURE,
66  const size_t mx = 10 ) const = 0;
67 
77  virtual StatusCode Print( const std::string& msg, const StatusCode st = StatusCode::SUCCESS,
78  const MSG::Level lev = MSG::INFO ) const = 0;
79 
89  virtual void Assert( const bool ok, const std::string& message = "",
90  const StatusCode sc = StatusCode::FAILURE ) const = 0;
91 
100  virtual void Exception( const std::string& msg, const GaudiException& exc,
101  const StatusCode sc = StatusCode::FAILURE ) const = 0;
102 
111  virtual void Exception( const std::string& msg, const std::exception& exc,
112  const StatusCode sc = StatusCode::FAILURE ) const = 0;
113 
121  virtual void Exception( const std::string& msg = "no message", const StatusCode sc = StatusCode::FAILURE ) const = 0;
122 
123 protected:
124  // protected destructor
125  virtual ~IErrorTool() = default;
126 };
127 
128 // ============================================================================
129 #endif // GAUDIALG_IERRORTOOL_H
130 // ============================================================================
constexpr static const auto FAILURE
Definition: StatusCode.h:88
Define general base for Gaudi exception.
DeclareInterfaceID(IAlgTool, 4, 0)
InterfaceID.
STL class.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
STL class.
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
The interface implemented by the AlgTool base class.
Definition: IAlgTool.h:23
#define GAUDI_API
Definition: Kernel.h:104