2 * ProcessNotFoundException.cxx
\r
4 * Copyright 2006,2007 Martin Quinson, Malek Cherier
\r
5 * All right reserved.
\r
7 * This program is free software; you can redistribute
\r
8 * it and/or modify it under the terms of the license
\r
9 *(GNU LGPL) which comes with this package.
\r
13 /* ProcessNotFoundException member functions implementation.
\r
16 #include <ProcessNotFoundException.hpp>
\r
27 ProcessNotFoundException::ProcessNotFoundException()
\r
29 this->reason = (char*) calloc(strlen("Host not found : unknown") + 1, sizeof(char));
\r
30 strcpy(this->reason, "Host not found : unknown");
\r
34 ProcessNotFoundException::ProcessNotFoundException(const ProcessNotFoundException& rProcessNotFoundException)
\r
36 const char* reason = rProcessNotFoundException.toString();
\r
37 this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
\r
38 strcpy(this->reason, reason);
\r
43 ProcessNotFoundException::ProcessNotFoundException(int PID)
\r
46 _itoa(PID, buff, 10);
\r
47 this->reason = (char*) calloc(strlen("Process not found : ") + strlen(buff) + 1, sizeof(char));
\r
48 sprintf(this->reason, "Host not found : %s", buff);
\r
52 ProcessNotFoundException::~ProcessNotFoundException()
\r
58 const char* ProcessNotFoundException::toString(void) const
\r
60 return (const char*)(this->reason);
\r
64 const ProcessNotFoundException& ProcessNotFoundException::operator = (const ProcessNotFoundException& rProcessNotFoundException)
\r
66 const char* reason = rProcessNotFoundException.toString();
\r
67 this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
\r
74 }// namespace SimGrid
\r