CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CMSexception.h
Go to the documentation of this file.
1 #ifndef Utilities_CMSexception_H
2 #define Utilities_CMSexception_H
3 //
4 // VI 1.0 3/4/2002
5 // exception with trace back and chaining
6 //
7 
9 
10 
11 
14 class CMSexception : public cms::Exception {
15 public:
16  CMSexception() throw() : cms::Exception("") {}
17  virtual ~CMSexception() throw() {}
18  virtual const char* what() const throw() = 0;
19  virtual std::string explainSelf (void) const { return what();}
20 };
21 
24 class Fastexception: public CMSexception {
25 public:
27  virtual ~Fastexception() throw() {}
28  virtual const char* what() const throw() { return 0;}
29  virtual std::string explainSelf (void) const { return "";}
30  virtual cms::Exception * clone (void) const { return new Fastexception(*this);}
31  virtual void rethrow (void) { throw *this;}
32 };
33 
34 
35 #include <string>
36 
40 public:
41  BaseGenexception() throw();
42  BaseGenexception(const std::string & mess) throw();
43  virtual ~BaseGenexception() throw();
44  virtual const char* what() const throw() { return message.c_str();}
45  virtual cms::Exception * clone (void) const { return new BaseGenexception(*this);}
46  virtual void rethrow (void) { throw *this;}
47 
48 private:
49  std::string message;
50 };
51 
52 
53 
55 #include<iosfwd>
56 
60 public:
61  Genexception() throw();
62  Genexception(const std::string & mess) throw();
63  virtual ~Genexception() throw();
64  const std::string & trace() const throw() { return trace_;}
65 
66  void add(Genexception * in) throw();
67 
68  void dump(std::ostream & o, bool it=false) const throw();
69  virtual cms::Exception * clone (void) const { return new Genexception(*this);}
70  virtual void rethrow (void) { throw *this;}
71 
72 private:
73  void traceit() throw();
74 
75 private:
76  std::string trace_;
77 
79 };
80 
81 namespace Capri {
82 
83  class Error : public Genexception {
84  public:
85  Error(const std::string & level, const std::string & mess) throw();
86  };
87 
88 
89  class Warning : public Error {
90  public:
91  explicit Warning(const std::string & mess) throw() : Error("Warning",mess){}
92  };
93 
94  class Severe : public Error {
95  public:
96  explicit Severe(const std::string & mess) throw() : Error("Severe",mess){}
97  };
98 
99  class Fatal : public Error {
100  public:
101  explicit Fatal(const std::string & mess) throw() : Error("Fatal",mess){}
102  };
103 
104 
105 }
106 
109 class GenTerminate: public Genexception {
110 public:
111  GenTerminate() throw();
112  GenTerminate(const std::string & mess) throw();
113  virtual ~GenTerminate() throw();
114 
115 };
116 
117 
120 class Success {
121 public:
122  Success();
123  ~Success();
124 
125 private:
126  std::string message;
127 };
128 
129 #endif
130 
void traceit()
Definition: CMSexception.cc:90
std::string trace_
Definition: CMSexception.h:76
virtual cms::Exception * clone(void) const
Definition: CMSexception.h:69
virtual void rethrow(void)
Definition: CMSexception.h:31
list namespace
Definition: asciidump.py:379
virtual const char * what() const =0
const std::string & trace() const
Definition: CMSexception.h:64
std::string message() const
Definition: Exception.cc:187
void dump(std::ostream &o, bool it=false) const
Definition: CMSexception.cc:78
virtual ~Fastexception()
Definition: CMSexception.h:27
Fatal(const std::string &mess)
Definition: CMSexception.h:101
virtual cms::Exception * clone(void) const
Definition: CMSexception.h:30
virtual cms::Exception * clone(void) const
Definition: CMSexception.h:45
std::string message
Definition: CMSexception.h:49
virtual std::string explainSelf(void) const
Definition: CMSexception.h:19
virtual const char * what() const
Definition: CMSexception.h:28
Warning(const std::string &mess)
Definition: CMSexception.h:91
virtual ~BaseGenexception()
Definition: CMSexception.cc:53
std::string message
Definition: CMSexception.h:126
virtual ~CMSexception()
Definition: CMSexception.h:17
#define private
Definition: FWFileEntry.h:18
virtual const char * what() const
Definition: CMSexception.h:44
tuple level
Definition: testEve_cfg.py:34
void add(Genexception *in)
Definition: CMSexception.cc:70
virtual ~Genexception()
Definition: CMSexception.cc:68
virtual void rethrow(void)
Definition: CMSexception.h:70
Severe(const std::string &mess)
Definition: CMSexception.h:96
own_ptr< Genexception > next
Definition: CMSexception.h:78
virtual void rethrow(void)
Definition: CMSexception.h:46
virtual std::string explainSelf(void) const
Definition: CMSexception.h:29