The Gaudi Framework  v33r1 (b1225454)
IErrorTool.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef GAUDIALG_IERRORTOOL_H
12 #define GAUDIALG_IERRORTOOL_H 1
13 // ============================================================================
14 // Include files
15 // ============================================================================
16 // STD & STL
17 // ============================================================================
18 #include <string>
19 // ============================================================================
20 // GaudiKernel
21 // ============================================================================
22 #include "GaudiKernel/IAlgTool.h"
24 #include "GaudiKernel/StatusCode.h"
25 // ============================================================================
26 class GaudiException;
27 
34 class GAUDI_API IErrorTool : virtual public IAlgTool {
35 public:
38 
39 public:
61  virtual StatusCode Error( const std::string& msg, const StatusCode st = StatusCode::FAILURE,
62  const size_t mx = 10 ) const = 0;
63 
74  virtual StatusCode Warning( const std::string& msg, const StatusCode st = StatusCode::FAILURE,
75  const size_t mx = 10 ) const = 0;
76 
86  virtual StatusCode Print( const std::string& msg, const StatusCode st = StatusCode::SUCCESS,
87  const MSG::Level lev = MSG::INFO ) const = 0;
88 
98  virtual void Assert( const bool ok, const std::string& message = "",
99  const StatusCode sc = StatusCode::FAILURE ) const = 0;
100 
109  virtual void Exception( const std::string& msg, const GaudiException& exc,
110  const StatusCode sc = StatusCode::FAILURE ) const = 0;
111 
120  virtual void Exception( const std::string& msg, const std::exception& exc,
121  const StatusCode sc = StatusCode::FAILURE ) const = 0;
122 
130  virtual void Exception( const std::string& msg = "no message", const StatusCode sc = StatusCode::FAILURE ) const = 0;
131 
132 protected:
133  // protected destructor
134  virtual ~IErrorTool() = default;
135 };
136 
137 // ============================================================================
138 #endif // GAUDIALG_IERRORTOOL_H
Define general base for Gaudi exception.
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
DeclareInterfaceID(IAlgTool, 4, 0)
InterfaceID.
STL class.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
STL class.
The interface implemented by the AlgTool base class.
Definition: IAlgTool.h:33
constexpr static const auto FAILURE
Definition: StatusCode.h:101
#define GAUDI_API
Definition: Kernel.h:81