Home   Class/Enum List   File List   Compound Members  

RtError.h
1 /************************************************************************/
10 /************************************************************************/
11 
12 #ifndef RTERROR_H
13 #define RTERROR_H
14 
15 #include <exception>
16 #include <iostream>
17 #include <string>
18 
19 class RtError : public std::exception
20 {
21  public:
23  enum Type {
35  };
36 
38  RtError( const std::string& message, Type type = RtError::UNSPECIFIED ) throw() : message_(message), type_(type) {}
39 
41  virtual ~RtError( void ) throw() {}
42 
44  virtual void printMessage( void ) const throw() { std::cerr << '\n' << message_ << "\n\n"; }
45 
47  virtual const Type& getType(void) const throw() { return type_; }
48 
50  virtual const std::string& getMessage(void) const throw() { return message_; }
51 
53  virtual const char* what( void ) const throw() { return message_.c_str(); }
54 
55  protected:
56  std::string message_;
57  Type type_;
58 };
59 
60 #endif

©2001-2013 Gary P. Scavone, McGill University. All Rights Reserved.
Maintained by Gary P. Scavone.