Diana Software
QDianaDebug.hh
Go to the documentation of this file.
1 #ifndef _Q_DIANA_DEBUG_HH_
2 #define _Q_DIANA_DEBUG_HH_
3 #include <string>
4 #include <iostream>
5 
6 class QError;
7 namespace std { class exception; };
8 
9 namespace Diana {
10  void SetDianaDebug(bool value);
11  bool GetDianaDebug();
12 #ifndef __CINT__
13  void Abort(const QError& err);
14  void Abort(std::exception& ex);
15  void Abort(const std::string& str);
16  void Abort(...);
17  extern bool DianaDebug;
18 #endif
19  // QRootCintTrigger(QDianaDebug)
20 };
21 
22 #ifndef __CINT__
23 void diana_stacktrace(std::ostream &o=std::cout,size_t MaxLines=63);
24 
25 
26 #define DianaThrow(obj)\
27  {\
28  if(Diana::DianaDebug) {\
29  Diana::Abort(obj);\
30  std::cout << "Debug Abort is set" << std::endl;\
31  } else {\
32  throw(obj);\
33  }\
34  }
35 
36 #endif
37 #endif
err
Definition: CheckOF.C:114
void diana_stacktrace(std::ostream &o=std::cout, size_t MaxLines=63)
Definition: QDianaDebug.cc:74
error class with error type and description
Definition: QError.hh:115
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...
bool GetDianaDebug()
Definition: QDianaDebug.cc:20
bool DianaDebug
Definition: QDianaDebug.cc:16
void Abort(const QError &err)
Definition: QDianaDebug.cc:23
void SetDianaDebug(bool value)
Definition: QDianaDebug.cc:18