X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9b1ec3c5445076d8f5827f850a9a5e9ea4853696..3406010cd31d6455d8ab9f96b312920dac884062:/src/cxx/BadAllocException.hpp diff --git a/src/cxx/BadAllocException.hpp b/src/cxx/BadAllocException.hpp index df050b8dea..69221ce55c 100644 --- a/src/cxx/BadAllocException.hpp +++ b/src/cxx/BadAllocException.hpp @@ -1,64 +1,69 @@ -/* - * BadAllocException.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 - -#include "Exception.hpp" - -namespace SimGrid -{ - namespace Msg - { - - class BadAllocException : public Exception - { - public: - - // Default constructor. - BadAllocException(); - - // Copy constructor. - BadAllocException(const BadAllocException& rBadAllocException); - - // This constructor takes the name of the object of the allocation failure. - BadAllocException(const char* objectName); - - // Destructor. - virtual ~BadAllocException(); - - // Operations. - - // Returns the reason of the exception : - // the message "Not enough memory to allocate : `object name'" - const char* toString(void) const; - - // Operators. - - // Assignement. - const BadAllocException& operator = (const BadAllocException& rBadAllocException); - - private : - - // Attributes. - - // A buffer used to build the message returned by the methode toString(). - char* reason; - }; - - - } // namespace Msg - -}// namespace SimGrid - - -#endif // !MSG_MSGEXCEPTION_HPP +/* + * BadAllocException.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_BADALLOCEXCEPTION_HPP +#define MSG_BADALLOCEXCEPTION_HPP + +#ifndef __cplusplus + #error BadAllocException.hpp requires C++ compilation (use a .cxx suffix) +#endif + +#include + +namespace SimGrid +{ + namespace Msg + { + + class SIMGRIDX_EXPORT BadAllocException : public Exception + { + public: + + // Default constructor. + BadAllocException(); + + // Copy constructor. + BadAllocException(const BadAllocException& rBadAllocException); + + // This constructor takes the name of the object of the allocation failure. + BadAllocException(const char* objectName); + + // Destructor. + virtual ~BadAllocException(); + + // Operations. + + // Returns the reason of the exception : + // the message "Not enough memory to allocate : `object name'" + const char* toString(void) const; + + // Operators. + + // Assignement. + const BadAllocException& operator = (const BadAllocException& rBadAllocException); + + private : + + // Attributes. + + // A buffer used to build the message returned by the methode toString(). + char* reason; + }; + + + } // namespace Msg + +}// namespace SimGrid + + +#endif // !MSG_BADALLOCEXCEPTION_HPP +