NEOCCA bindings Specification  0.2.8
Exception.hh
Go to the documentation of this file.
1 #ifndef neo_Exception_hh_seen
2 #define neo_Exception_hh_seen
3 
4 /* A file of auxiliaries that mainly distract the new reader. */
5 
6 namespace neo {
7 namespace cca {
8 
9 //===================================================================
18  Unexpected = -1,
31 };
32 
33 //===================================================================
34 
48 class Exception : public ::std::exception
49 {
50 private:
52  ::std::string ccaMessage;
53 
54 public:
55  virtual ~Exception() throw (){}
56  virtual const char *what() { return ccaMessage.c_str(); }
57 
58  Exception(enum ExceptionType t, const ::std::string & message) throw ()
59  { ccaType = t; ccaMessage = message; }
60 
61  Exception(enum ExceptionType t) throw ()
62  { ccaType = t; ccaMessage = ::std::string(""); }
63 
64  Exception() throw ()
65  { ccaType = Nonstandard; ccaMessage = ::std::string(""); }
66 
67  Exception(const ::std::string& message) throw ()
68  { ccaType = Nonstandard; ccaMessage = message; }
69 
70  enum ExceptionType getType() { return ccaType; }
71 
73  ::std::string getMessage() {return ccaMessage; }
74 
75  void setType( enum ExceptionType t) { ccaType = t; }
76 
77  void setMessage(const ::std::string & message) { ccaMessage = message; }
78 
79 };
80 
81 
82 } // end namespace cca
83 } // end namespace neo
84 
85 #endif // neo_Exception_hh_seen
86 
Definition: Exception.hh:23
Definition: Exception.hh:18
::std::string ccaMessage
Definition: Exception.hh:52
enum ExceptionType getType()
Definition: Exception.hh:70
Definition: Exception.hh:20
Definition: Exception.hh:29
virtual ~Exception()
Definition: Exception.hh:55
ExceptionType
Types of cca framework exception so far, other than typemismatch.
Definition: Exception.hh:17
void setType(enum ExceptionType t)
Definition: Exception.hh:75
This class extends the STL std::exception to allow the thrower to specify the message that the stl sa...
Definition: Exception.hh:48
Exception(enum ExceptionType t, const ::std::string &message)
Definition: Exception.hh:58
enum ExceptionType ccaType
Definition: Exception.hh:51
Definition: Exception.hh:28
virtual const char * what()
Definition: Exception.hh:56
Definition: Exception.hh:25
Exception(const ::std::string &message)
Definition: Exception.hh:67
Definition: Exception.hh:27
::std::string getMessage()
string form of std::exception::what().
Definition: Exception.hh:73
Definition: Exception.hh:26
Definition: Exception.hh:19
Exception()
Definition: Exception.hh:64
Exception(enum ExceptionType t)
Definition: Exception.hh:61
Definition: Exception.hh:21
Definition: Exception.hh:24
Definition: Exception.hh:22
void setMessage(const ::std::string &message)
Definition: Exception.hh:77
Definition: Exception.hh:30
This is neoclassic – the ::classic::gov::cca headers updated to be similar to the official CCA speci...
Definition: neocca.hh:62