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 /* LogicException member functions implementation.
\r
16 #include <LogicException.hpp>
\r
27 LogicException::LogicException()
\r
29 this->reason = (char*) calloc(strlen("Logic exception : no detail") + 1, sizeof(char));
\r
30 strcpy(this->reason, "Logic exception : no detail");
\r
34 LogicException::LogicException(const LogicException& rLogicException)
\r
36 const char* reason = rLogicException.toString();
\r
37 this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
\r
38 strcpy(this->reason, reason);
\r
43 LogicException::LogicException(const char* detail)
\r
45 this->reason = (char*) calloc(strlen("Logic exception : ") + strlen(detail) + 1, sizeof(char));
\r
46 sprintf(this->reason, "Logic exception : %s", detail);
\r
50 LogicException::~LogicException()
\r
56 const char* LogicException::toString(void) const
\r
58 return (const char*)(this->reason);
\r
62 const LogicException& LogicException::operator = (const LogicException& rLogicException)
\r
64 const char* reason = rLogicException.toString();
\r
65 this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
\r
72 }// namespace SimGrid
\r