1 #include "LogicException.hpp"
\r
14 LogicException::LogicException()
\r
16 this->reason = (char*) calloc(strlen("Logic exception : no detail") + 1, sizeof(char));
\r
17 strcpy(this->reason, "Logic exception : no detail");
\r
21 LogicException::LogicException(const LogicException& rLogicException)
\r
23 const char* reason = rLogicException.toString();
\r
24 this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
\r
25 strcpy(this->reason, reason);
\r
30 LogicException::LogicException(const char* detail)
\r
32 this->reason = (char*) calloc(strlen("Logic exception : ") + strlen(detail) + 1, sizeof(char));
\r
33 sprintf(this->reason, "Logic exception : %s", detail);
\r
37 LogicException::~LogicException()
\r
43 const char* LogicException::toString(void) const
\r
45 return (const char*)(this->reason);
\r
49 const LogicException& LogicException::operator = (const LogicException& rLogicException)
\r
51 const char* reason = rLogicException.toString();
\r
52 this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
\r
59 }// namespace SimGrid
\r