X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/13ab86ee48bea707ffb0041659f65dac2351c6d5..9ce7a44037c1f190439342139440802c782a4a06:/src/cxx/OutOfBoundsException.cxx diff --git a/src/cxx/OutOfBoundsException.cxx b/src/cxx/OutOfBoundsException.cxx index 3fb9412d82..fe2570e526 100644 --- a/src/cxx/OutOfBoundsException.cxx +++ b/src/cxx/OutOfBoundsException.cxx @@ -1,81 +1,81 @@ -/* - * OutOfBoundsException.cxx - * - * 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. - * - */ - - /* OutOfBoundsException member functions implementation. - */ - -#include - -#include -#include -#include - - -namespace SimGrid -{ - namespace Msg - { - - OutOfBoundsException::OutOfBoundsException() - { - this->reason = (char*) calloc(strlen("Out of bounds") + 1, sizeof(char)); - strcpy(this->reason, "Out of bounds"); - } - - - OutOfBoundsException::OutOfBoundsException(const OutOfBoundsException& rOutOfBoundsException) - { - const char* reason = rOutOfBoundsException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - strcpy(this->reason, reason); - - } - - OutOfBoundsException::OutOfBoundsException(int pos) - { - this->reason = (char*) calloc(strlen("Out of bounds ") + 21 + 1, sizeof(char)); - sprintf(this->reason, "Out of bounds %d", pos); - } - - OutOfBoundsException::OutOfBoundsException(int pos1, int pos2) - { - this->reason = (char*) calloc(strlen("Out of bounds ") + (2*21) + 1, sizeof(char)); - sprintf(this->reason, "Out of bounds %d : %d", pos1, pos2); - } - - - OutOfBoundsException::~OutOfBoundsException() - { - if(this->reason) - free(this->reason); - } - - const char* OutOfBoundsException::toString(void) const - { - return (const char*)(this->reason); - } - - - const OutOfBoundsException& OutOfBoundsException::operator = (const OutOfBoundsException& rOutOfBoundsException) - { - const char* reason = rOutOfBoundsException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - - return *this; - } - - } // namespace Msg - -}// namespace SimGrid - - - +/* + * OutOfBoundsException.cxx + * + * 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. + * + */ + + /* OutOfBoundsException member functions implementation. + */ + +#include + +#include +#include +#include + + +namespace SimGrid +{ + namespace Msg + { + + OutOfBoundsException::OutOfBoundsException() + { + this->reason = (char*) calloc(strlen("Out of bounds") + 1, sizeof(char)); + strcpy(this->reason, "Out of bounds"); + } + + + OutOfBoundsException::OutOfBoundsException(const OutOfBoundsException& rOutOfBoundsException) + { + const char* reason = rOutOfBoundsException.toString(); + this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); + strcpy(this->reason, reason); + + } + + OutOfBoundsException::OutOfBoundsException(int pos) + { + this->reason = (char*) calloc(strlen("Out of bounds ") + 21 + 1, sizeof(char)); + sprintf(this->reason, "Out of bounds %d", pos); + } + + OutOfBoundsException::OutOfBoundsException(int pos1, int pos2) + { + this->reason = (char*) calloc(strlen("Out of bounds ") + (2*21) + 1, sizeof(char)); + sprintf(this->reason, "Out of bounds %d : %d", pos1, pos2); + } + + + OutOfBoundsException::~OutOfBoundsException() + { + if(this->reason) + free(this->reason); + } + + const char* OutOfBoundsException::toString(void) const + { + return (const char*)(this->reason); + } + + + const OutOfBoundsException& OutOfBoundsException::operator = (const OutOfBoundsException& rOutOfBoundsException) + { + const char* reason = rOutOfBoundsException.toString(); + this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); + + return *this; + } + + } // namespace Msg + +}// namespace SimGrid + + +