C++ main module for stochmagnet Package  1.0
CORE_Exception.h
Go to the documentation of this file.
1 #ifndef CORE_Exception_H
2 #define CORE_Exception_H
3 
4 #include "CORE_Object.h"
5 
6 
7 //standard exception
8 #include <stdexcept>
9 
10 
17 class CORE_Exception: public std::runtime_error {
18 
19 public:
20 
21 
22 private:
23  // ATTRIBUTES
24 
25  // ASSOCIATIONS
26 
27  // METHODS
28 
29 
30 public:
31  // CONSTRUCTORS
37  CORE_Exception(const tString& package);
38 
44  CORE_Exception(const tString& package,
45  const tString& where,
46  const tString& what);
47 
48 
56  CORE_Exception(const tString& package,
57  const tString& assertion,
58  const tString& file,
59  const tInteger& line,
60  const tString& function) ;
61 
62  // DESTRUCTORS
63 
64  // METHOD
65 
66 
74  inline tMemSize getMemorySize() const {
75  return sizeof(*this);
76  }
77 
80  inline tString getMessage() const {
81  tString ret(what());
82  return ret;
83  }
86  virtual tString toString() const {
87  return getMessage();
88  }
89 
95  friend std::ostream& operator << (std::ostream& out,const CORE_Exception& obj) {
96  out << obj.toString();
97  return out;
98  };
99 
100 };
101 #endif
this class describes the exceptions raised for CORE package
Definition: CORE_Exception.h:17
tString getMessage() const
return the message of the exception
Definition: CORE_Exception.h:80
friend std::ostream & operator<<(std::ostream &out, const CORE_Exception &obj)
print the class object
Definition: CORE_Exception.h:95
CORE_Exception()
build an exception
Definition: CORE_Exception.cpp:7
virtual tString toString() const
return the message of the exception
Definition: CORE_Exception.h:86
tMemSize getMemorySize() const
return the memory size of the class
Definition: CORE_Exception.h:74
#define tString
Definition: types.h:147
#define tMemSize
Definition: types.h:166
#define tInteger
Definition: types.h:114