OpenDaVINCI  4.15.3
Exceptions.h
Go to the documentation of this file.
1 
20 #ifndef OPENDAVINCI_CORE_EXCEPTIONS_EXCEPTIONS_H_
21 #define OPENDAVINCI_CORE_EXCEPTIONS_EXCEPTIONS_H_
22 
23 #include <exception>
24 #include <string>
25 
27 
28 namespace odcore {
29  namespace exceptions {
30 
31  using namespace std;
32 
41  class OPENDAVINCI_API Exceptions: public exception {
42 
43  private:
47  Exceptions():
48  m_message("undefined exception"),
49  m_fileName("undefined file"),
50  m_lineNumber(0),
51  m_whatMessage(NULL) {};
52 
53  public:
73  Exceptions(const string &exceptionMessage, const string &fileName, const uint32_t &lineNumber);
74 
80  Exceptions(const Exceptions &obj);
81 
82  virtual ~Exceptions() throw ();
83 
90  Exceptions& operator=(const Exceptions &obj);
91 
98  const char* what() const throw ();
99 
105  const string toString() const;
106 
112  virtual const string getExceptionName() const = 0;
113 
119  const string getMessage() const;
120 
126  const string getFileName() const;
127 
133  uint32_t getLineNumber() const;
134 
135  private:
136  string m_message;
137  string m_fileName;
138  uint32_t m_lineNumber;
139  mutable char *m_whatMessage; // This attribute is mutable for allocation memory in the what()-message.
140  };
141 
142  /* Exception declarations. */
143  OPENDAVINCI_CORE_DECLARE_EXCEPTION(ArrayIndexOutOfBoundsException);
144  OPENDAVINCI_CORE_DECLARE_EXCEPTION(CommandLineParserException);
145  OPENDAVINCI_CORE_DECLARE_EXCEPTION(ConferenceException);
146  OPENDAVINCI_CORE_DECLARE_EXCEPTION(ConfigurationFileNotFoundException);
147  OPENDAVINCI_CORE_DECLARE_EXCEPTION(ConnectException);
148  OPENDAVINCI_CORE_DECLARE_EXCEPTION(ConnectionException);
149  OPENDAVINCI_CORE_DECLARE_EXCEPTION(ConnectionAcceptorException);
150  OPENDAVINCI_CORE_DECLARE_EXCEPTION(InvalidArgumentException);
152  OPENDAVINCI_CORE_DECLARE_EXCEPTION(ModulesNotRespondingException);
153  OPENDAVINCI_CORE_DECLARE_EXCEPTION(NoDatabaseAvailableException);
154  OPENDAVINCI_CORE_DECLARE_EXCEPTION(RealtimeExecutionException);
155  OPENDAVINCI_CORE_DECLARE_EXCEPTION(RealtimeSetupException);
156  OPENDAVINCI_CORE_DECLARE_EXCEPTION(SingletonException);
157  OPENDAVINCI_CORE_DECLARE_EXCEPTION(SocketException);
158  OPENDAVINCI_CORE_DECLARE_EXCEPTION(TransformationException);
159  OPENDAVINCI_CORE_DECLARE_EXCEPTION(ThreadControlException);
160  OPENDAVINCI_CORE_DECLARE_EXCEPTION(ThreadException);
161  OPENDAVINCI_CORE_DECLARE_EXCEPTION(ToManyTestSenderStarted);
162  OPENDAVINCI_CORE_DECLARE_EXCEPTION(UnimplementedException);
163  OPENDAVINCI_CORE_DECLARE_EXCEPTION(ValueForKeyNotFoundException);
164  OPENDAVINCI_CORE_DECLARE_EXCEPTION(DMCPServerAlreadyStartedException);
165  OPENDAVINCI_CORE_DECLARE_EXCEPTION(DMCPServerNotFoundException);
166  OPENDAVINCI_CORE_DECLARE_EXCEPTION(DMCPServerConnectionException);
167  OPENDAVINCI_CORE_DECLARE_EXCEPTION(DMCPClientConfigurationException);
168  OPENDAVINCI_CORE_DECLARE_EXCEPTION(SCNXScenarioFileNotFoundException);
169  OPENDAVINCI_CORE_DECLARE_EXCEPTION(SCNScenarioVisitorException);
170  OPENDAVINCI_CORE_DECLARE_EXCEPTION(SITSituationVisitorException);
171 
172  }
173 } // odcore::exceptions
174 
175 #endif /*OPENDAVINCI_CORE_EXCEPTIONS_EXCEPTIONS_H_*/
#define OPENDAVINCI_API
Definition: opendavinci.h:67
Definition: Exceptions.h:41
OPENDAVINCI_CORE_DECLARE_EXCEPTION(ArrayIndexOutOfBoundsException)