X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0f767a4eb0cf070d331e73d9be7d2c2be4f71dd5..8bed05033724fb48c90cdc76f30a4d5ebcc050a5:/src/cxx/MsgException.hpp diff --git a/src/cxx/MsgException.hpp b/src/cxx/MsgException.hpp index bcc3c4491f..7d978f33dc 100644 --- a/src/cxx/MsgException.hpp +++ b/src/cxx/MsgException.hpp @@ -1,43 +1,65 @@ -#ifndef MSG_EXCEPTION_HPP -#define MSG_EXCEPTION_HPP +/* + * MsgException.hpp + * + * Copyright 2006,2007 Martin Quinson, Malek Cherier + * All right reserved. + * + * This program is free software; you can redistribute + * it and/or modify it under the terms of the license + *(GNU LGPL) which comes with this package. + * + */ + +#ifndef MSG_MSGEXCEPTION_HPP +#define MSG_MSGEXCEPTION_HPP -namespace msg +#include + +namespace SimGrid { - class MsgException + namespace Msg { - public: - // Default constructor. - MsgException(); - - // This constructor takes as parameter the message of the - // MsgException object. - MsgException(const char* msg); - - // Copy constructor. - MsgException(const MsgException& rMsgException); - - // Destructor. - virtual ~MsgException(); - - // Operations. - - // Returns the message of the exception. - const char* what(void) const; - - - // Getters/setters. - - // Operators. + class SIMGRIDX_EXPORT MsgException : public Exception + { + public: + + // Default constructor. + MsgException(); + + // Copy constructor. + MsgException(const MsgException& rMsgException); + + // This constructor takes the reason of the exception. + MsgException(const char* reason); + + // Destructor. + virtual ~MsgException(); + + // Operations. + + // Returns the reason of the exception : + // the message "Internal exception `reason'" + const char* toString(void) const; + + // Operators. + + // Assignement. + const MsgException& operator = (const MsgException& rMsgException); + + private : + + // Attributes. + + // A buffer used to build the message returned by the methode toString(). + char* reason; + }; - private: - // Attributes. - - // The message of the exception. - const char* msg; - - }; -} + } // namespace Msg + +}// namespace SimGrid + + +#endif // !MSG_MSGEXCEPTION_HPP -#endif // !MSG_EXCEPTION_HPP \ No newline at end of file