Salome HOME
Fix for opening old saves without copy attribute in SketchPlugin_SketchEntity
[modules/shaper.git] / src / Events / Events_Error.h
index 7e2e62e293ac15c691ef55c01aeab06fb4f05f03..e288f9f55e90a5e80f2f971d03541f2861ae394d 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
 /*
  * Events_Error.h
  *
 
 #include <string>
 
-class EVENTS_EXPORT Events_Error: public Events_Message
+/**\class Events_Error
+ * \ingroup EventsLoop
+ * \brief An error message event.
+ *
+ * Is generated by any algorithm or GUI of the application to inform the user about
+ * the problem. In GUI mode all such errors are collected in the message log window.
+ */
+class Events_Error : public Events_Message
 {
-  char* myDescription; ///< pointer to the description of the error
+  std::string myDescription;  ///< the description of the error
 
 public:
-  virtual ~Events_Error();
+  /// default destructor   
+  EVENTS_EXPORT virtual ~Events_Error();
 
-  static Events_ID errorID();
-  char* description() const;
-  static void send(char* theDescription, const void* theSender = 0);
-  static void send(std::string theDescription, const void* theSender = 0);
+  /// Identifier of this event (one for all errors)
+  EVENTS_EXPORT static Events_ID errorID();
+  /// Specific error string
+  EVENTS_EXPORT const char* description() const;
+  /// Allows to send an error quickly: it creates and sends the error object automatically
+  EVENTS_EXPORT static void send(const std::string& theDescription, const void* theSender = 0);
 
 protected:
-  Events_Error(char* theDescription, const void* theSender = 0);
+  /// Default constructor. Use "send" message for generation an error.
+  EVENTS_EXPORT Events_Error(const std::string& theDescription, const void* theSender = 0);
 };
 
 #endif /* EVENTS_ERROR_H_ */