File indexing completed on 2025-12-15 10:28:11
0001
0002
0003
0004 #ifndef ROOT_Math_GenVector_GenVector_exception
0005 #define ROOT_Math_GenVector_GenVector_exception 1
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #include <stdexcept>
0017 #include <string>
0018
0019 namespace ROOT {
0020 namespace Math {
0021
0022 class GenVector_exception;
0023 inline void Throw(GenVector_exception &e);
0024 inline void GenVector_Throw(const char *);
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 class GenVector_exception : public std::runtime_error {
0035 public:
0036 GenVector_exception(const std::string &s) : runtime_error(s) {}
0037
0038
0039
0040
0041 static bool EnableThrow()
0042 {
0043 bool tmp = GenVector_exception::IsOn();
0044 IsOn() = true;
0045 return tmp;
0046 }
0047 static bool DisableThrow()
0048 {
0049 bool tmp = GenVector_exception::IsOn();
0050 IsOn() = false;
0051 return tmp;
0052 }
0053
0054 private:
0055 friend void Throw(GenVector_exception &);
0056 friend void GenVector_Throw(const char *);
0057
0058 static bool &IsOn()
0059 {
0060 static bool isOn = false;
0061 return isOn;
0062 };
0063
0064 };
0065
0066
0067
0068
0069
0070 inline void Throw(GenVector_exception &e)
0071 {
0072 if (GenVector_exception::IsOn())
0073 throw e;
0074 }
0075
0076
0077 inline void GenVector_Throw(const char *s)
0078 {
0079 if (!GenVector_exception::IsOn())
0080 return;
0081 GenVector_exception e(s);
0082 throw e;
0083 }
0084
0085 }
0086 }
0087
0088 #endif