X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FEvents%2FEvents_Error.h;h=b344c6e36f9a3319939a1d351e4247158a9d9d27;hb=51f9a2d4ddb07cb536d1bfef694995b81e4079af;hp=561c987ce141be705eb03dc88f7b049babde742b;hpb=db0e21ea2f1117dd9af3320009ba8b50dc2e828b;p=modules%2Fshaper.git diff --git a/src/Events/Events_Error.h b/src/Events/Events_Error.h index 561c987ce..b344c6e36 100644 --- a/src/Events/Events_Error.h +++ b/src/Events/Events_Error.h @@ -22,26 +22,28 @@ * 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_EXPORT Events_Error : public Events_Message +class Events_Error : public Events_Message { - char* myDescription; ///< pointer to the description of the error + std::string myDescription; ///< the description of the error public: /// default destructor - virtual ~Events_Error(); + EVENTS_EXPORT virtual ~Events_Error(); /// Identifier of this event (one for all errors) - static Events_ID errorID(); + EVENTS_EXPORT static Events_ID errorID(); /// Specific error string - char* description() const; + EVENTS_EXPORT const char* description() const; /// Allows to send an error quickly: it creates and sends the error object automatically - static void send(char* theDescription, const void* theSender = 0); - /// Allows to send an error quickly: it creates and sends the error object automatically - static void send(std::string theDescription, const void* theSender = 0); + EVENTS_EXPORT static void send(const std::string& theDescription, const void* theSender = 0); + + /// Throws a C++ exception about using an empty AIS object + /// \theDescription an exception information + EVENTS_EXPORT static void throwException(const std::string& theDescription); protected: /// Default constructor. Use "send" message for generation an error. - Events_Error(char* theDescription, const void* theSender = 0); + EVENTS_EXPORT Events_Error(const std::string& theDescription, const void* theSender = 0); }; #endif /* EVENTS_ERROR_H_ */