File indexing completed on 2025-01-18 10:10:10
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 namespace GenVector {
0025 inline void Throw(const char *);
0026 }
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 class GenVector_exception : public std::runtime_error {
0037 public:
0038 GenVector_exception(const std::string &s) : runtime_error(s) {}
0039
0040
0041
0042
0043 static bool EnableThrow()
0044 {
0045 bool tmp = GenVector_exception::IsOn();
0046 IsOn() = true;
0047 return tmp;
0048 }
0049 static bool DisableThrow()
0050 {
0051 bool tmp = GenVector_exception::IsOn();
0052 IsOn() = false;
0053 return tmp;
0054 }
0055
0056 private:
0057 friend void Throw(GenVector_exception &);
0058 friend void GenVector::Throw(const char *);
0059
0060 static bool &IsOn()
0061 {
0062 static bool isOn = false;
0063 return isOn;
0064 };
0065
0066 };
0067
0068
0069
0070
0071
0072 inline void Throw(GenVector_exception &e)
0073 {
0074 if (GenVector_exception::IsOn())
0075 throw e;
0076 }
0077
0078 namespace GenVector {
0079
0080 inline void Throw(const char *s)
0081 {
0082 if (!GenVector_exception::IsOn())
0083 return;
0084 GenVector_exception e(s);
0085 throw e;
0086 }
0087 }
0088
0089 }
0090 }
0091
0092 #endif