1 #ifndef __FASTJET_ERROR_HH__
2#define __FASTJET_ERROR_HH__
36#include "fastjet/internal/base.hh"
37#include "fastjet/config.h"
39#if (!defined(FASTJET_HAVE_EXECINFO_H)) || defined(__FJCORE__)
40#include "fastjet/LimitedWarning.hh"
42#ifdef FASTJET_HAVE_LIMITED_THREAD_SAFETY
47FASTJET_BEGIN_NAMESPACE
62 Error(
const std::string & message);
68 std::string
message()
const {
return _message;}
79 static void set_print_backtrace(
bool enabled);
87#ifdef FASTJET_HAVE_LIMITED_THREAD_SAFETY
92 static void set_default_stream_and_mutex(std::ostream * ostr, std::mutex * stream_mutex) {
94 _stream_mutex = stream_mutex;
101#if defined(FASTJET_HAVE_EXECINFO_H) && defined(FASTJET_HAVE_DEMANGLING_SUPPORT)
103 std::string _demangle(
const char* symbol);
107 std::string _message;
109#ifdef FASTJET_HAVE_LIMITED_THREAD_SAFETY
110 static std::atomic<bool> _print_errors;
111 static std::atomic<bool> _print_backtrace;
112 static std::atomic<std::ostream *> _default_ostr;
113 static std::atomic<std::mutex *> _stream_mutex;
115 static bool _print_errors;
116 static bool _print_backtrace;
117 static std::ostream * _default_ostr;
121#if (!defined(FASTJET_HAVE_EXECINFO_H)) || defined(__FJCORE__)
122 static LimitedWarning _execinfo_undefined;
142 InternalError(
const std::string & message_in) :
Error(std::string(
"*** CRITICAL INTERNAL FASTJET ERROR *** CONTACT THE AUTHORS *** ") + message_in){ }
base class corresponding to errors that can be thrown by FastJet
virtual ~Error()
virtual dummy dtor
static void set_print_errors(bool print_errors)
controls whether the error message (and the backtrace, if its printing is enabled) is printed out or ...
Error()
default constructors
static void set_default_stream(std::ostream *ostr)
sets the default output stream for all errors; by default cerr; if it's null then error output is sup...
std::string message() const
the error message
std::string description() const
an alternative access to the error message (more standard)
class corresponding to critical internal errors
InternalError(const std::string &message_in)
ctor with error message: just add a bit of info to the message and pass it to the base class