+#include "HostNotFoundException.hpp"\r
+\r
+#include <string.h>\r
+#include <stdlib.h>\r
+#include <stdio.h>\r
+\r
+using namespace std;\r
+\r
+namespace SimGrid\r
+{\r
+ namespace Msg\r
+ {\r
+ \r
+ HostNotFoundException::HostNotFoundException()\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
+ HostNotFoundException::HostNotFoundException(const HostNotFoundException& rHostNotFoundException)\r
+ {\r
+ const char* reason = rHostNotFoundException.toString();\r
+ this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));\r
+ strcpy(this->reason, reason);\r
+ \r
+ }\r
+ \r
+ \r
+ HostNotFoundException::HostNotFoundException(const char* name)\r
+ {\r
+ this->reason = (char*) calloc(strlen("Host not found : ") + strlen(name) + 1, sizeof(char));\r
+ sprintf(this->reason, "Host not found : %s", name);\r
+ }\r
+ \r
+ \r
+ HostNotFoundException::~HostNotFoundException()\r
+ {\r
+ if(this->reason)\r
+ free(this->reason);\r
+ }\r
+ \r
+ const char* HostNotFoundException::toString(void) const\r
+ {\r
+ return (const char*)(this->reason); \r
+ }\r
+ \r
+ \r
+ const HostNotFoundException& HostNotFoundException::operator = (const HostNotFoundException& rHostNotFoundException)\r
+ {\r
+ const char* reason = rHostNotFoundException.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