+++ /dev/null
-#include <ProcessNotFoundException.hpp>\r
-\r
-#include <string.h>\r
-#include <stdlib.h>\r
-#include <stdio.h>\r
-\r
-namespace SimGrid\r
-{\r
- namespace Msg\r
- {\r
- \r
- ProcessNotFoundException::ProcessNotFoundException()\r
- {\r
- this->reason = (char*) calloc(strlen("Host not found : unknown") + 1, sizeof(char));\r
- strcpy(this->reason, "Host not found : unknown");\r
- }\r
- \r
- \r
- ProcessNotFoundException::ProcessNotFoundException(const ProcessNotFoundException& rProcessNotFoundException)\r
- {\r
- const char* reason = rProcessNotFoundException.toString();\r
- this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));\r
- strcpy(this->reason, reason);\r
- \r
- }\r
- \r
- \r
- ProcessNotFoundException::ProcessNotFoundException(int PID)\r
- {\r
- char buff[7] = {0};\r
- _itoa(PID, buff, 10);\r
- this->reason = (char*) calloc(strlen("Process not found : ") + strlen(buff) + 1, sizeof(char));\r
- sprintf(this->reason, "Host not found : %s", buff);\r
- }\r
- \r
- \r
- ProcessNotFoundException::~ProcessNotFoundException()\r
- {\r
- if(this->reason)\r
- free(this->reason);\r
- }\r
- \r
- const char* ProcessNotFoundException::toString(void) const\r
- {\r
- return (const char*)(this->reason); \r
- }\r
- \r
- \r
- const ProcessNotFoundException& ProcessNotFoundException::operator = (const ProcessNotFoundException& rProcessNotFoundException)\r
- {\r
- const char* reason = rProcessNotFoundException.toString();\r
- this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));\r
- \r
- return *this;\r
- }\r
- \r
- } // namespace Msg \r
-\r
-}// namespace SimGrid\r
-\r
-\r
-\r