Salome HOME
Union of validator and filter functionalities.
[modules/shaper.git] / src / Events / Events_Error.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 /*
4  * Events_Error.h
5  *
6  *  Created on: Apr 28, 2014
7  *      Author: sbh
8  */
9
10 #ifndef EVENTS_ERROR_H_
11 #define EVENTS_ERROR_H_
12
13 #include <Events.h>
14 #include <Events_Message.h>
15
16 #include <string>
17
18 /**\class Events_Error
19  * \ingroup EventsLoop
20  * \brief An error message event.
21  *
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.
24  */
25 class EVENTS_EXPORT Events_Error : public Events_Message
26 {
27   char* myDescription;  ///< pointer to the description of the error
28
29 public:
30   /// default destructor   
31   virtual ~Events_Error();
32
33   /// Identifier of this event (one for all errors)
34   static Events_ID errorID();
35   /// Specific error string
36   char* description() const;
37   /// Allows to send an error quickly: it creates and sends the error object automatically
38   static void send(char* theDescription, const void* theSender = 0);
39   /// Allows to send an error quickly: it creates and sends the error object automatically
40   static void send(std::string theDescription, const void* theSender = 0);
41
42 protected:
43   /// Default constructor. Use "send" message for generation an error.
44   Events_Error(char* theDescription, const void* theSender = 0);
45 };
46
47 #endif /* EVENTS_ERROR_H_ */