1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
6 * Created on: Apr 28, 2014
10 #ifndef EVENTS_ERROR_H_
11 #define EVENTS_ERROR_H_
14 #include <Events_Message.h>
18 /**\class Events_Error
20 * \brief An error message event.
22 * Is generated by any algorithm or GUI of the application to inform the user about
23 * the problem. In GUI mode all such errors are collected in the message log window.
25 class Events_Error : public Events_Message
27 std::string myDescription; ///< the description of the error
30 /// default destructor
31 EVENTS_EXPORT virtual ~Events_Error();
33 /// Identifier of this event (one for all errors)
34 EVENTS_EXPORT static Events_ID errorID();
35 /// Specific error string
36 EVENTS_EXPORT const char* description() const;
37 /// Allows to send an error quickly: it creates and sends the error object automatically
38 EVENTS_EXPORT static void send(const std::string& theDescription, const void* theSender = 0);
40 /// Throws a C++ exception about using an empty AIS object
41 /// \theDescription an exception information
42 EVENTS_EXPORT static void throwException(const std::string& theDescription);
45 /// Default constructor. Use "send" message for generation an error.
46 EVENTS_EXPORT Events_Error(const std::string& theDescription, const void* theSender = 0);
49 #endif /* EVENTS_ERROR_H_ */