The Gaudi Framework  v38r0 (2143aa4c)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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:
62  const size_t mx = 10 ) const = 0;
63 
75  const size_t mx = 10 ) const = 0;
76 
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
IErrorTool::Assert
virtual void Assert(const bool ok, const std::string &message="", const StatusCode sc=StatusCode::FAILURE) const =0
Assertion - throw exception, if condition is not fulfilled.
GaudiHive.precedence.message
message
Definition: precedence.py:19
IErrorTool::Exception
virtual void Exception(const std::string &msg, const std::exception &exc, const StatusCode sc=StatusCode::FAILURE) const =0
Create and (re)-throw the exception.
std::string
STL class.
IAlgTool
Definition: IAlgTool.h:33
std::exception
STL class.
IErrorTool::~IErrorTool
virtual ~IErrorTool()=default
MSG::INFO
@ INFO
Definition: IMessageSvc.h:25
GaudiException
Definition: GaudiException.h:31
GaudiMP.FdsRegistry.msg
msg
Definition: FdsRegistry.py:19
IErrorTool::Exception
virtual void Exception(const std::string &msg, const GaudiException &exc, const StatusCode sc=StatusCode::FAILURE) const =0
Create and (re)-throw the exception.
StatusCode.h
IMessageSvc.h
StatusCode
Definition: StatusCode.h:65
IAlgTool.h
IErrorTool::DeclareInterfaceID
DeclareInterfaceID(IErrorTool, 2, 0)
InterfaceID.
IErrorTool
Definition: IErrorTool.h:34
IErrorTool::Exception
virtual void Exception(const std::string &msg="no message", const StatusCode sc=StatusCode::FAILURE) const =0
Create and throw the exception.
IErrorTool::Error
virtual StatusCode Error(const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const =0
Print the error message, return status code and perform the statistics of error messages.
MSG::Level
Level
Definition: IMessageSvc.h:25
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
IErrorTool::Warning
virtual StatusCode Warning(const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const =0
Print the warning message, return status code and perform the statistics of warning messages.
IErrorTool::Print
virtual StatusCode Print(const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const MSG::Level lev=MSG::INFO) const =0
Print the message and return status code.
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81