1 #include <LogicException.hpp>
\r
12 LogicException::LogicException()
\r
14 this->reason = (char*) calloc(strlen("Logic exception : no detail") + 1, sizeof(char));
\r
15 strcpy(this->reason, "Logic exception : no detail");
\r
19 LogicException::LogicException(const LogicException& rLogicException)
\r
21 const char* reason = rLogicException.toString();
\r
22 this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
\r
23 strcpy(this->reason, reason);
\r
28 LogicException::LogicException(const char* detail)
\r
30 this->reason = (char*) calloc(strlen("Logic exception : ") + strlen(detail) + 1, sizeof(char));
\r
31 sprintf(this->reason, "Logic exception : %s", detail);
\r
35 LogicException::~LogicException()
\r
41 const char* LogicException::toString(void) const
\r
43 return (const char*)(this->reason);
\r
47 const LogicException& LogicException::operator = (const LogicException& rLogicException)
\r
49 const char* reason = rLogicException.toString();
\r
50 this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
\r
57 }// namespace SimGrid
\r