X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9b1ec3c5445076d8f5827f850a9a5e9ea4853696..d9f6a4409b58ac98618a4b646af874f06ceac856:/src/cxx/HostNotFoundException.cxx diff --git a/src/cxx/HostNotFoundException.cxx b/src/cxx/HostNotFoundException.cxx index c0dac52229..213ab12f40 100644 --- a/src/cxx/HostNotFoundException.cxx +++ b/src/cxx/HostNotFoundException.cxx @@ -1,62 +1,75 @@ -#include "HostNotFoundException.hpp" - -#include -#include -#include - -using namespace std; - -namespace SimGrid -{ - namespace Msg - { - - HostNotFoundException::HostNotFoundException() - { - this->reason = (char*) calloc(strlen("Host not found : unknown") + 1, sizeof(char)); - strcpy(this->reason, "Host not found : unknown"); - } - - - HostNotFoundException::HostNotFoundException(const HostNotFoundException& rHostNotFoundException) - { - const char* reason = rHostNotFoundException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - strcpy(this->reason, reason); - - } - - - HostNotFoundException::HostNotFoundException(const char* name) - { - this->reason = (char*) calloc(strlen("Host not found : ") + strlen(name) + 1, sizeof(char)); - sprintf(this->reason, "Host not found : %s", name); - } - - - HostNotFoundException::~HostNotFoundException() - { - if(this->reason) - free(this->reason); - } - - const char* HostNotFoundException::toString(void) const - { - return (const char*)(this->reason); - } - - - const HostNotFoundException& HostNotFoundException::operator = (const HostNotFoundException& rHostNotFoundException) - { - const char* reason = rHostNotFoundException.toString(); - this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); - - return *this; - } - - } // namespace Msg - -}// namespace SimGrid - - - +/* + * HostNotFoundException.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. + * + */ + + /* HostNotFoundException member functions implementation. + */ + +#include + +#include +#include +#include + +namespace SimGrid +{ + namespace Msg + { + + HostNotFoundException::HostNotFoundException() + { + this->reason = (char*) calloc(strlen("Host not found : unknown") + 1, sizeof(char)); + strcpy(this->reason, "Host not found : unknown"); + } + + + HostNotFoundException::HostNotFoundException(const HostNotFoundException& rHostNotFoundException) + { + const char* reason = rHostNotFoundException.toString(); + this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); + strcpy(this->reason, reason); + + } + + + HostNotFoundException::HostNotFoundException(const char* name) + { + this->reason = (char*) calloc(strlen("Host not found : ") + strlen(name) + 1, sizeof(char)); + sprintf(this->reason, "Host not found : %s", name); + } + + + HostNotFoundException::~HostNotFoundException() + { + if(this->reason) + free(this->reason); + } + + const char* HostNotFoundException::toString(void) const + { + return (const char*)(this->reason); + } + + + const HostNotFoundException& HostNotFoundException::operator = (const HostNotFoundException& rHostNotFoundException) + { + const char* reason = rHostNotFoundException.toString(); + this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char)); + + return *this; + } + + } // namespace Msg + +}// namespace SimGrid + + +